aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/http/request.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-11-09 21:23:52 -0800
committerRobert Griesemer <gri@golang.org>2009-11-09 21:23:52 -0800
commit3bb0032cd6187ca1f42b68599b94036cb6b7e054 (patch)
tree3293f2b050aa0a83e6b3deb4240f4eab5ef571fd /src/pkg/http/request.go
parentbaba292998286e5d9011705a9b4173a2ec99c5e0 (diff)
downloadgo-3bb0032cd6187ca1f42b68599b94036cb6b7e054.tar.xz
- 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.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/http/request.go b/src/pkg/http/request.go
index 008f965708..c91ca3a00b 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
}