diff options
| author | Robert Griesemer <gri@golang.org> | 2009-11-09 21:23:52 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2009-11-09 21:23:52 -0800 |
| commit | 9aad19327eb719775a874f8f18bb15958db1d471 (patch) | |
| tree | c515081857e0b9ad897c6d35b0be64fe4c346688 /src/pkg/http/request.go | |
| parent | 073e240233589933c43143c997247c33206bb066 (diff) | |
| download | golang-9aad19327eb719775a874f8f18bb15958db1d471.tar.gz | |
- replaced gofmt expression formatting algorithm with
rsc's algorithm
- applied gofmt -w misc src
- partial CL (last chunk)
R=rsc, r
http://go/go-review/1024041
Diffstat (limited to 'src/pkg/http/request.go')
| -rw-r--r-- | src/pkg/http/request.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/http/request.go b/src/pkg/http/request.go index 008f96570..c91ca3a00 100644 --- a/src/pkg/http/request.go +++ b/src/pkg/http/request.go @@ -24,7 +24,7 @@ const ( maxLineLength = 1024; // assumed < bufio.DefaultBufSize maxValueLength = 1024; maxHeaderLines = 1024; - chunkSize = 4<<10; // 4 KB chunks + chunkSize = 4 << 10; // 4 KB chunks ) // HTTP request parsing errors. @@ -293,7 +293,7 @@ func readKeyValue(b *bufio.Reader) (key, value string, err os.Error) { if line, e = readLineBytes(b); e != nil { return "", "", e } - value += " "+string(line); + value += " " + string(line); if len(value) >= maxValueLength { return "", "", &badStringError{"value too long for key", key} @@ -360,10 +360,10 @@ func CanonicalHeaderKey(s string) string { upper := true; for i, v := range a { if upper && 'a' <= v && v <= 'z' { - a[i] = v+'A'-'a' + a[i] = v + 'A' - 'a' } if !upper && 'A' <= v && v <= 'Z' { - a[i] = v+'a'-'A' + a[i] = v + 'a' - 'A' } upper = false; if v == '-' { @@ -422,7 +422,7 @@ func (cr *chunkedReader) Read(b []uint8) (n int, err os.Error) { } } if uint64(len(b)) > cr.n { - b = b[0 : cr.n] + b = b[0:cr.n] } n, cr.err = cr.r.Read(b); cr.n -= uint64(n); @@ -484,7 +484,7 @@ func ReadRequest(b *bufio.Reader) (req *Request, err os.Error) { // to concatenating the values separated by commas. oldvalue, present := req.Header[key]; if present { - req.Header[key] = oldvalue+","+value + req.Header[key] = oldvalue + "," + value } else { req.Header[key] = value } |
