diff options
author | Joey Hess <joey@kitenet.net> | 2014-03-12 12:19:48 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-03-12 12:19:48 -0400 |
commit | 672a4323b5711352c1d1f45176cf97d96df97de3 (patch) | |
tree | a4fb7ba12eb25e353add5b3b0523eda223c566cc /Utility | |
parent | c5801f029458a899fb681d89628303433119c1c9 (diff) |
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.
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/WebApp.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs index c9cb32106..31d3711f1 100644 --- a/Utility/WebApp.hs +++ b/Utility/WebApp.hs @@ -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__ |