quick fix to build with old warp-tls

Debian stable's warp-tls is too old to support the new https feature well,
so only use http with that old version.

Note that the webapp still depends on warp-tls, because the TLSSettings
type is used.
This commit is contained in:
Joey Hess 2014-03-12 12:19:48 -04:00
parent 411b7faaac
commit 06218428c7
3 changed files with 16 additions and 3 deletions

View file

@ -74,11 +74,15 @@ browserProc url = proc "xdg-open" [url]
runWebApp :: Maybe TLSSettings -> Maybe HostName -> Wai.Application -> (SockAddr -> IO ()) -> IO ()
runWebApp tlssettings h app observer = withSocketsDo $ do
sock <- getSocket h
void $ forkIO $
(maybe runSettingsSocket (\ts -> runTLSSocket ts) tlssettings)
webAppSettings sock app
void $ forkIO $ run webAppSettings sock app
sockaddr <- fixSockAddr <$> getSocketName sock
observer sockaddr
where
#ifdef WITH_WEBAPP_HTTPS
run = (maybe runSettingsSocket (\ts -> runTLSSocket ts) tlssettings)
#else
run = runSettingsSocket
#endif
fixSockAddr :: SockAddr -> SockAddr
#ifdef __ANDROID__