diff options
| author | Russ Cox <rsc@golang.org> | 2008-10-20 12:37:07 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2008-10-20 12:37:07 -0700 |
| commit | 7c7a525d182a93473071307392fb47e8478aedd1 (patch) | |
| tree | f3a86526166a4e7adbee1efdd9b7d435f88263f5 /src/lib/http | |
| parent | a6b546fe3116095761b35976a231f64d28082934 (diff) | |
| download | go-7c7a525d182a93473071307392fb47e8478aedd1.tar.xz | |
add io.ReadWriteClose and use it in http
R=r
DELTA=15 (6 added, 7 deleted, 2 changed)
OCL=17447
CL=17461
Diffstat (limited to 'src/lib/http')
| -rw-r--r-- | src/lib/http/conn.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/lib/http/conn.go b/src/lib/http/conn.go index e7024ed606..15c0707f3e 100644 --- a/src/lib/http/conn.go +++ b/src/lib/http/conn.go @@ -11,16 +11,9 @@ import ( "os" ) -// Read/write/close interface. -type RWC interface { - Read(p *[]byte) (n int, err *os.Error); - Write(p *[]byte) (n int, err *os.Error); - Close() *os.Error; -} - // Active HTTP connection (server side). export type Conn struct { - rwc RWC; + rwc io.ReadWriteClose; br *bufio.BufRead; bw *bufio.BufWrite; close bool; @@ -28,7 +21,7 @@ export type Conn struct { } // Create new connection from rwc. -export func NewConn(rwc RWC) (c *Conn, err *os.Error) { +export func NewConn(rwc io.ReadWriteClose) (c *Conn, err *os.Error) { c = new(Conn); c.rwc = rwc; if c.br, err = bufio.NewBufRead(rwc); err != nil { |
