As far as I can tell by looking at the code, ReadRequest() will
return an io.ErrUnexpectedEOF if it can't read the Request line or an
io.EOF if it can't read a complete header line.
If it can read a complete request header it won't return any errors.
--
=====================
http://jessta.id.au
Currently it's either an io.ErrUnexpectedEOF or an EOF depending on
where the EOF is encounted.
Perhaps it should just be always an io.ErrUnexpectedEOF?
--
=====================
http://jessta.id.au
On Mon, Mar 12, 2012 at 12:18 PM, Andrew Gerrand <a...@google.com> wrote:Currently it's either an io.ErrUnexpectedEOF or an EOF depending on
> You should be able to rely on ReadRequest returning an error if it can't
> read the request correctly. If the reason for that is EOF, you should get an
> io.ErrUnexpectedEOF.
where the EOF is encounted.
Perhaps it should just be always an io.ErrUnexpectedEOF?
I would think that getting an EOF while in the middle of reading a
header line would be unexpected.
The function never returns EOF in the case of an expected EOF(like a
valid end of input), it will only return EOF if the header is somehow
malformed or only partially sent.
--
=====================
http://jessta.id.au
What's wrong with it saying it saw EOF at a likely EOF spot vs an unexpected EOF spot?
It does the opposite. See http://play.golang.org/p/eYUX4vZzNBI expect EOF at request boundaries and ErrUnexpectedEOF for partial requests.