Skip to content

Commit a2be1aa

Browse files
committed
logtail: remove unncessary response read
Effectively reverts tailscale#249, since the server side was fixed (with tailscale#251?) to send a 200 OK/content-length 0 response. Signed-off-by: Mihai Parparita <mihai@tailscale.com>
1 parent ce99474 commit a2be1aa

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

logtail/logtail.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -463,14 +463,6 @@ func (l *Logger) upload(ctx context.Context, body []byte, origlen int) (uploaded
463463
return uploaded, fmt.Errorf("log upload of %d bytes %s failed %d: %q", len(body), compressedNote, resp.StatusCode, b)
464464
}
465465

466-
// Try to read to EOF, in case server's response is
467-
// chunked. We want to reuse the TCP connection if it's
468-
// HTTP/1. On success, we expect 0 bytes.
469-
// TODO(bradfitz): can remove a few days after 2020-04-04 once
470-
// server is fixed.
471-
if resp.ContentLength == -1 {
472-
resp.Body.Read(make([]byte, 1))
473-
}
474466
return true, nil
475467
}
476468

0 commit comments

Comments
 (0)