~singpolyma/network-protocol-xmpp

a0191ab270107916c5a53d56c44d82544cc93ed9 — John Millikin 12 years ago 47b6d64
If the remote server closes the connection, send EOF to the XML parser.
1 files changed, 2 insertions(+), 1 deletions(-)

M Network/Protocol/XMPP/Monad.hs
M Network/Protocol/XMPP/Monad.hs => Network/Protocol/XMPP/Monad.hs +2 -1
@@ 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