aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/http
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/http')
-rw-r--r--src/pkg/http/client_test.go6
-rw-r--r--src/pkg/http/fs.go2
-rw-r--r--src/pkg/http/request.go4
3 files changed, 4 insertions, 8 deletions
diff --git a/src/pkg/http/client_test.go b/src/pkg/http/client_test.go
index 6cde4a41ca..ca4235879e 100644
--- a/src/pkg/http/client_test.go
+++ b/src/pkg/http/client_test.go
@@ -25,11 +25,7 @@ func TestClient(t *testing.T) {
r.Body.Close();
}
- // TODO: io.ErrEOF check is needed because we're sometimes getting
- // this error when nothing is actually wrong. rsc suspects a bug
- // in bufio. Can remove the ErrEOF check once the bug is fixed
- // (expected to occur within a few weeks of this writing, 6/9/09).
- if err != nil && err != io.ErrEOF {
+ if err != nil {
t.Errorf("Error fetching URL: %v", err);
} else {
s := string(b);
diff --git a/src/pkg/http/fs.go b/src/pkg/http/fs.go
index 108734c47f..fd18096f0b 100644
--- a/src/pkg/http/fs.go
+++ b/src/pkg/http/fs.go
@@ -142,7 +142,7 @@ func serveFileInternal(c *Conn, r *Request, name string, redirect bool) {
} else {
// read first chunk to decide between utf-8 text and binary
var buf [1024]byte;
- n, err := io.FullRead(f, &buf);
+ n, err := io.ReadFull(f, &buf);
b := buf[0:n];
if isText(b) {
c.SetHeader("Content-Type", "text-plain; charset=utf-8");
diff --git a/src/pkg/http/request.go b/src/pkg/http/request.go
index 5356f55253..a0207ea71d 100644
--- a/src/pkg/http/request.go
+++ b/src/pkg/http/request.go
@@ -151,8 +151,8 @@ func (req *Request) write(w io.Writer) os.Error {
io.WriteString(w, "\r\n");
if req.Body != nil {
- nCopied, err := io.Copy(req.Body, w);
- if err != nil && err != io.ErrEOF {
+ _, err := io.Copy(req.Body, w);
+ if err != nil {
return err;
}
}