From a0191ab270107916c5a53d56c44d82544cc93ed9 Mon Sep 17 00:00:00 2001 From: John Millikin Date: Tue, 16 Nov 2010 12:27:55 -0800 Subject: [PATCH] If the remote server closes the connection, send EOF to the XML parser. --- Network/Protocol/XMPP/Monad.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Network/Protocol/XMPP/Monad.hs b/Network/Protocol/XMPP/Monad.hs index fb5a09b..c0c1d6e 100644 --- a/Network/Protocol/XMPP/Monad.hs +++ b/Network/Protocol/XMPP/Monad.hs @@ -161,7 +161,8 @@ readEvents done = xmpp where let nextEvents = do -- TODO: read in larger increments bytes <- liftTLS $ H.hGetBytes h 1 - parsed <- liftIO $ X.parse p bytes False + let eof = B.length bytes == 0 + parsed <- liftIO $ X.parse p bytes eof case parsed of Left err -> E.throwError $ TransportError err Right events -> return events -- 2.45.2