Skip to content

Commit

Permalink
Don't remove connection from WaitGroup on keepAlive (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiodangelis authored Mar 12, 2022
1 parent 01a36c4 commit 64227a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ func New(cfg *config.Config) (*Server, error) {
}
}
// Remove connection from the waitgroup when done
defer waitgroup.Done()
if !cfg.KeepAlive {
defer waitgroup.Done()
}
w.Header().Set("Content-Disposition", "attachment; filename="+
app.payload.Filename)
http.ServeFile(w, r, app.payload.Path)
Expand Down

0 comments on commit 64227a4

Please sign in to comment.