summaryrefslogtreecommitdiff
path: root/lbc/lbc.go
diff options
context:
space:
mode:
Diffstat (limited to 'lbc/lbc.go')
-rw-r--r--lbc/lbc.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/lbc/lbc.go b/lbc/lbc.go
index d1cfdc8..4542676 100644
--- a/lbc/lbc.go
+++ b/lbc/lbc.go
@@ -133,9 +133,10 @@ func (s *syntheticCountingReader) Read(p []byte) (n int, err error) {
func (lbu *LoadBearingConnectionUpload) doUpload(ctx context.Context) bool {
lbu.uploaded = 0
s := &syntheticCountingReader{n: &lbu.uploaded, ctx: ctx}
- resp, _ := lbu.client.Post(lbu.Path, "application/octet-stream", s)
+ if resp, err := lbu.client.Post(lbu.Path, "application/octet-stream", s); err == nil {
+ resp.Body.Close()
+ }
lbu.valid = false
- resp.Body.Close()
if lbu.debug {
fmt.Printf("Ending a load-bearing upload.\n")
}