
On Fri, Feb 18, 2005 at 11:36:57PM +0100, Bjorn Bringert wrote:
John Goerzen wrote:
It turns out that Network.Socket.recv raises an EOF error when it gets back 0 bytes of data. HTTP is expecting it to return an empty list for some reason.
The below patch fixed it for me. [...]
Hmm, strange. Is that recv behavior a bug or a feature?
I don't know, but it's explicitly there whatever it is. From ghc 6.2.2: let len' = fromIntegral len if len' == 0 then ioError (mkEOFError "Network.Socket.recv") else peekCStringLen (ptr,len') It appears this change was committed to fptools in version 1.26 of Socket.hsc on July 15, 2002. http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/network/Network/... Which arguably is not what one would expect recv to do, and in any case is undocumented at http://www.haskell.org/ghc/docs/latest/html/libraries/network/Network.Socket... Still, 2002 was awhile back, so I'm still surprised nobody else noticed. -- John