fix(oohelperd): use throw-away HTTPClient, Dialer, Resolver (#833)
This diff modifies the implementation of oohelperd in the master branch to always use throw-away HTTPClient, Dialer, and Resolver. The rationale of this change is to ensure we're not hitting limits of the HTTPClient regarding the max number of connections per host. This issue is described at https://github.com/ooni/probe/issues/2182. While there, it feels more correct to use throw-away Dialer and Resolver. We have a different patch for the release/3.15 branch because of netx-related refactorings: https://github.com/ooni/probe-cli/pull/832.
This commit is contained in:
parent
59410edba9
commit
a4d17085f5
9 changed files with 87 additions and 60 deletions
|
|
@ -14,10 +14,10 @@ import (
|
|||
|
||||
// Handler implements the Web Connectivity test helper HTTP API.
|
||||
type Handler struct {
|
||||
Client model.HTTPClient
|
||||
Dialer model.Dialer
|
||||
MaxAcceptableBody int64
|
||||
Resolver model.Resolver
|
||||
NewClient func() model.HTTPClient
|
||||
NewDialer func() model.Dialer
|
||||
NewResolver func() model.Resolver
|
||||
}
|
||||
|
||||
func (h Handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue