1
0
mirror of https://github.com/golang/go synced 2024-11-19 01:54:39 -07:00

http: return the correct error if a header line is too long.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/2372042
This commit is contained in:
Stephen Ma 2010-10-06 22:04:18 +11:00
parent 4e3c58cd62
commit 8d130f5d2d

View File

@ -249,6 +249,8 @@ func readLineBytes(b *bufio.Reader) (p []byte, err os.Error) {
// If the caller asked for a line, there should be a line.
if err == os.EOF {
err = io.ErrUnexpectedEOF
} else if err == bufio.ErrBufferFull {
err = ErrLineTooLong
}
return nil, err
}