[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36
John Goerzen
jgoerzen at complete.org
Fri Apr 23 14:52:51 UTC 2010
The following commit has been merged in the master branch:
commit 12bd04026e929b0d7d769b04120a5f8c6d8e6387
Author: John Goerzen <jgoerzen at complete.org>
Date: Wed Dec 22 02:17:58 2004 +0100
It compiles
Keywords:
(jgoerzen at complete.org--projects/missingh--head--0.7--patch-130)
diff --git a/ChangeLog b/ChangeLog
index e8e787e..e2df792 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
# arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
#
+2004-12-21 19:17:58 GMT John Goerzen <jgoerzen at complete.org> patch-130
+
+ Summary:
+ It compiles
+ Revision:
+ missingh--head--0.7--patch-130
+
+
+ modified files:
+ ChangeLog libsrc/MissingH/Network/FTP/Server.hs
+
+
2004-12-21 19:05:43 GMT John Goerzen <jgoerzen at complete.org> patch-129
Summary:
diff --git a/libsrc/MissingH/Network/FTP/Server.hs b/libsrc/MissingH/Network/FTP/Server.hs
index 375eddb..6db8d0c 100644
--- a/libsrc/MissingH/Network/FTP/Server.hs
+++ b/libsrc/MissingH/Network/FTP/Server.hs
@@ -51,16 +51,13 @@ import MissingH.IO.HVFS
import Data.Char
import MissingH.Printf
-data FTPServer = FTPServer
- {handle :: Handle,
- fs :: forall a. HVFS a => a
- }
+data FTPServer = forall a. HVFS a => FTPServer Handle a
s_crlf = "\r\n"
ftpPutStrLn :: FTPServer -> String -> IO ()
-ftpPutStrLn h text =
- do hPutStr (handle h) (text ++ s_crlf)
- hFlush (handle h)
+ftpPutStrLn (FTPServer h _) text =
+ do hPutStr h (text ++ s_crlf)
+ hFlush h
{- | Send a reply code, handling multi-line text as necessary. -}
sendReply :: FTPServer -> Int -> String -> IO ()
@@ -78,7 +75,7 @@ sendReply h codei text =
ftpHandler :: forall a. HVFS a => a -> Handle -> SockAddr -> IO ()
ftpHandler f h sa =
- let serv = FTPServer {fs = f, handle = h}
+ let serv = FTPServer h f
in
traplogging "MissingH.Network.FTP.Server" NOTICE "" $
do sendReply serv 220 "Welcome to MissingH.Network.FTP.Server."
@@ -93,13 +90,13 @@ commands =
]
commandLoop :: FTPServer -> SockAddr -> IO ()
-commandLoop h sa =
+commandLoop h@(FTPServer fh _) sa =
let errorhandler e = do noticeM "MissingH.Network.FTP.Server"
("Closing due to error: " ++ (show e))
- hClose (handle h)
+ hClose fh
return False
in do continue <- (flip catch) errorhandler
- (do x <- parseCommand (handle h)
+ (do x <- parseCommand fh
case x of
Left err -> do sendReply h 500 $
"Couldn't parse command: " ++ (show err)
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list