[Haskell-cafe] Re: Strange HTTP module behavior [PATCH]
GK at ninebynine.org
Mon Feb 21 09:58:30 EST 2005
Hmmm... FWIW, I've been using a lightly modified version of Bjorn's
version of HTTP in a modified HaXml parser, and it worked fine for
accessing external entities. But that almost certainly did not involve
receiving zero bytes.
At 16:58 18/02/05 -0600, John Goerzen wrote:
>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
> 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.
>Which arguably is not what one would expect recv to do, and in any case
>is undocumented at
>Still, 2002 was awhile back, so I'm still surprised nobody else noticed.
>Haskell-Cafe mailing list
>Haskell-Cafe at haskell.org
More information about the Haskell-Cafe