]> Cypherpunks repositories - gostls13.git/commitdiff
http: return the correct error if a header line is too long.
authorStephen Ma <stephenm@golang.org>
Wed, 6 Oct 2010 11:04:18 +0000 (22:04 +1100)
committerStephen Ma <stephenm@golang.org>
Wed, 6 Oct 2010 11:04:18 +0000 (22:04 +1100)
R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/2372042

src/pkg/http/request.go

index d0de2732d2884e3ea1dd0664b74b32b513eaacb1..45533fab521b2c93875311476e58f646e85b68a9 100644 (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
        }