~singpolyma/network-protocol-xmpp

942061d3e5bbddd90bb94956055853e1813f718f — John Millikin 14 years ago dd3b80f
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