aboutsummaryrefslogtreecommitdiff
path: root/src/lib/http
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2008-12-19 03:05:37 -0800
committerRuss Cox <rsc@golang.org>2008-12-19 03:05:37 -0800
commit08ca30bbfad04d3ca1bf7ae75c291b91ecb00aef (patch)
tree183e8cd345f5f895d2cbc36dd8f8be93640303c3 /src/lib/http
parentd47d888ba663014e6aa8ca043e694f4b2a5898b8 (diff)
downloadgo-08ca30bbfad04d3ca1bf7ae75c291b91ecb00aef.tar.xz
change *map to map; *chan to chan; new(T) to new(*T)
fix bugs left over from *[] to [] conversion. TBR=r OCL=21576 CL=21581
Diffstat (limited to 'src/lib/http')
-rw-r--r--src/lib/http/conn.go2
-rw-r--r--src/lib/http/request.go10
-rw-r--r--src/lib/http/url.go2
3 files changed, 6 insertions, 8 deletions
diff --git a/src/lib/http/conn.go b/src/lib/http/conn.go
index 15c0707f3e..ec33d9e8ef 100644
--- a/src/lib/http/conn.go
+++ b/src/lib/http/conn.go
@@ -22,7 +22,7 @@ export type Conn struct {
// Create new connection from rwc.
export func NewConn(rwc io.ReadWriteClose) (c *Conn, err *os.Error) {
- c = new(Conn);
+ c = new(*Conn);
c.rwc = rwc;
if c.br, err = bufio.NewBufRead(rwc); err != nil {
return nil, err
diff --git a/src/lib/http/request.go b/src/lib/http/request.go
index 36fa77033f..c997ee81e2 100644
--- a/src/lib/http/request.go
+++ b/src/lib/http/request.go
@@ -37,7 +37,7 @@ export type Request struct {
pmajor int; // 1
pminor int; // 0
- header *map[string] string;
+ header map[string] string;
close bool;
host string;
@@ -45,18 +45,16 @@ export type Request struct {
useragent string;
}
-var NIL []byte // TODO(rsc)
-
// Read a line of bytes (up to \n) from b.
// Give up if the line exceeds MaxLineLength.
// The returned bytes are a pointer into storage in
// the bufio, so they are only valid until the next bufio read.
func ReadLineBytes(b *bufio.BufRead) (p []byte, err *os.Error) {
if p, err = b.ReadLineSlice('\n'); err != nil {
- return NIL, err
+ return nil, err
}
if len(p) >= MaxLineLength {
- return NIL, LineTooLong
+ return nil, LineTooLong
}
// Chop off trailing white space.
@@ -183,7 +181,7 @@ func ParseHTTPVersion(vers string) (int, int, bool) {
// Read and parse a request from b.
export func ReadRequest(b *bufio.BufRead) (req *Request, err *os.Error) {
- req = new(Request);
+ req = new(*Request);
// First line: GET /index.html HTTP/1.0
var s string;
diff --git a/src/lib/http/url.go b/src/lib/http/url.go
index 8df18eb305..b985c9757f 100644
--- a/src/lib/http/url.go
+++ b/src/lib/http/url.go
@@ -131,7 +131,7 @@ export func ParseURL(rawurl string) (url *URL, err *os.Error) {
if rawurl == "" {
return nil, BadURL
}
- url = new(URL);
+ url = new(*URL);
url.raw = rawurl;
// Split off possible leading "http:", "mailto:", etc.