Skip to content

Commit

Permalink
[DO NOT MERGE] disable http keepalives
Browse files Browse the repository at this point in the history
This disables keeping http connections alive in our API and Gateway servers. It
"fixes" #5168 but we really don't want to do this in practice.

License: MIT
Signed-off-by: Steven Allen <[email protected]>
  • Loading branch information
Stebalien committed Jun 29, 2018
1 parent 336520d commit aad8f81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/corehttp/corehttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ func Serve(node *core.IpfsNode, lis net.Listener, options ...ServeOption) error
}

node.Process().Go(func(p goprocess.Process) {
serverError = http.Serve(lis, handler)
server := http.Server{
Handler: handler,
}
server.SetKeepAlivesEnabled(false)
serverError = server.Serve(lis)
close(serverExited)
})

Expand Down

0 comments on commit aad8f81

Please sign in to comment.