remove buggy --listen=host:port support

This commit is contained in:
Joey Hess 2014-02-28 22:53:26 -04:00
parent 0bc8dabb54
commit d41367cc08
4 changed files with 11 additions and 14 deletions

View file

@ -115,13 +115,13 @@ getSocket h = do
use sock
where
#else
addrs <- getAddrInfo (Just hints) (Just hostname) port
addrs <- getAddrInfo (Just hints) (Just hostname) Nothing
case (partition (\a -> addrFamily a == AF_INET) addrs) of
(v4addr:_, _) -> go v4addr
(_, v6addr:_) -> go v6addr
_ -> error "unable to bind to a local socket"
where
(hostname, port) = maybe (localhost, Nothing) splitHostPort h
hostname = fromMaybe localhost h
hints = defaultHints { addrSocketType = Stream }
{- Repeated attempts because bind sometimes fails for an
- unknown reason on OSX. -}
@ -142,18 +142,6 @@ getSocket h = do
listen sock maxListenQueue
return sock
{- Splits address:port. For IPv6, use [address]:port. The port is optional. -}
splitHostPort :: String -> (HostName, Maybe ServiceName)
splitHostPort s
| "[" `isPrefixOf` s = let (h, p) = break (== ']') (drop 1 s)
in if "]:" `isPrefixOf` p
then (h, Just $ drop 2 p)
else (h, Nothing)
| otherwise = let (h, p) = separate (== ':') s
in if null p
then (h, Nothing)
else (h, Just p)
{- Checks if debugging is actually enabled. -}
debugEnabled :: IO Bool
debugEnabled = do

3
debian/changelog vendored
View file

@ -1,5 +1,8 @@
git-annex (5.20140228) UNRELEASED; urgency=medium
* webapp: Now supports HTTPS.
* webapp: No longer supports a port specified after --listen, since
it was buggy, and that use case is better supported by setting up HTTPS.
* Probe for quvi version at run time.
* webapp: Filter out from Switch Repository list any
repositories listed in autostart file that don't have a

View file

@ -44,3 +44,6 @@ WebApp crashed: unable to bind to local socket
> to use when something else is already listening there. --[[Joey]]
[[!tag /design/assistant]]
>> --listen no longer accepts a port. Use the new HTTPS support instead.
>> [[done]] --[[Joey]]

View file

@ -19,3 +19,6 @@ I am running my "origin" repositories on a headless server. Managing these with
# End of transcript or log.
"""]]
>> --listen no longer accepts a port. Use the new HTTPS support instead.
>> [[done]] --[[Joey]]