Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved lookupIPAddress to where it is used.

  • Loading branch information...
commit f87905e51896318c3a74749e3052621cb152d488 1 parent cffd97a
@jgm authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 Gitit.hs
View
14 Gitit.hs
@@ -365,13 +365,6 @@ handle pathtest meth responder = uriRest $ \uri ->
else noHandle ]
else anyRequest noHandle
-lookupIPAddr :: String -> IO (Maybe String)
-lookupIPAddr hostname = do
- addrs <- getAddrInfo (Just defaultHints) (Just hostname) Nothing
- if null addrs
- then return Nothing
- else return $ Just $ takeWhile (/=':') $ show $ addrAddress $ head addrs
-
-- | Returns path portion of URI, without initial /.
-- Consecutive spaces are collapsed. We don't want to distinguish 'Hi There' and 'Hi There'.
uriPath :: String -> String
@@ -1067,6 +1060,13 @@ registerUser _ params = do
formattedPage (defaultPageLayout { pgShowPageTools = False, pgTabs = [], pgTitle = "Register for an account" })
"_register" (params { pMessages = errors })
+lookupIPAddr :: String -> IO (Maybe String)
+lookupIPAddr hostname = do
+ addrs <- getAddrInfo (Just defaultHints) (Just hostname) Nothing
+ if null addrs
+ then return Nothing
+ else return $ Just $ takeWhile (/=':') $ show $ addrAddress $ head addrs
+
showHighlightedSource :: String -> Params -> Web Response
showHighlightedSource file params = do
mbCached <- lookupCache file (pRevision params)
Please sign in to comment.
Something went wrong with that request. Please try again.