remove buggy --listen=host:port support
This commit is contained in:
parent
0bc8dabb54
commit
d41367cc08
4 changed files with 11 additions and 14 deletions
|
@ -115,13 +115,13 @@ getSocket h = do
|
||||||
use sock
|
use sock
|
||||||
where
|
where
|
||||||
#else
|
#else
|
||||||
addrs <- getAddrInfo (Just hints) (Just hostname) port
|
addrs <- getAddrInfo (Just hints) (Just hostname) Nothing
|
||||||
case (partition (\a -> addrFamily a == AF_INET) addrs) of
|
case (partition (\a -> addrFamily a == AF_INET) addrs) of
|
||||||
(v4addr:_, _) -> go v4addr
|
(v4addr:_, _) -> go v4addr
|
||||||
(_, v6addr:_) -> go v6addr
|
(_, v6addr:_) -> go v6addr
|
||||||
_ -> error "unable to bind to a local socket"
|
_ -> error "unable to bind to a local socket"
|
||||||
where
|
where
|
||||||
(hostname, port) = maybe (localhost, Nothing) splitHostPort h
|
hostname = fromMaybe localhost h
|
||||||
hints = defaultHints { addrSocketType = Stream }
|
hints = defaultHints { addrSocketType = Stream }
|
||||||
{- Repeated attempts because bind sometimes fails for an
|
{- Repeated attempts because bind sometimes fails for an
|
||||||
- unknown reason on OSX. -}
|
- unknown reason on OSX. -}
|
||||||
|
@ -142,18 +142,6 @@ getSocket h = do
|
||||||
listen sock maxListenQueue
|
listen sock maxListenQueue
|
||||||
return sock
|
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. -}
|
{- Checks if debugging is actually enabled. -}
|
||||||
debugEnabled :: IO Bool
|
debugEnabled :: IO Bool
|
||||||
debugEnabled = do
|
debugEnabled = do
|
||||||
|
|
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -1,5 +1,8 @@
|
||||||
git-annex (5.20140228) UNRELEASED; urgency=medium
|
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.
|
* Probe for quvi version at run time.
|
||||||
* webapp: Filter out from Switch Repository list any
|
* webapp: Filter out from Switch Repository list any
|
||||||
repositories listed in autostart file that don't have a
|
repositories listed in autostart file that don't have a
|
||||||
|
|
|
@ -44,3 +44,6 @@ WebApp crashed: unable to bind to local socket
|
||||||
> to use when something else is already listening there. --[[Joey]]
|
> to use when something else is already listening there. --[[Joey]]
|
||||||
|
|
||||||
[[!tag /design/assistant]]
|
[[!tag /design/assistant]]
|
||||||
|
|
||||||
|
>> --listen no longer accepts a port. Use the new HTTPS support instead.
|
||||||
|
>> [[done]] --[[Joey]]
|
||||||
|
|
|
@ -19,3 +19,6 @@ I am running my "origin" repositories on a headless server. Managing these with
|
||||||
|
|
||||||
# End of transcript or log.
|
# End of transcript or log.
|
||||||
"""]]
|
"""]]
|
||||||
|
|
||||||
|
>> --listen no longer accepts a port. Use the new HTTPS support instead.
|
||||||
|
>> [[done]] --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue