1
0
mirror of https://github.com/golang/go synced 2024-09-25 05:20:13 -06:00

net/http: configure http2 transport only once

it looks like we should abort trying to configure the http2 transport
again, once it has been configured already.

Otherwise there will be no effect of these checks and changes, as they
will be overridden later again and the disable logic below will have no
effect, too.

So it really looks like we just forgot a return statement here.

Change-Id: Ic99b3bbc662a4e1e1bdbde77681bd1ae597255ad
Reviewed-on: https://go-review.googlesource.com/134795
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Ingo Oeser 2018-09-12 01:16:29 +02:00 committed by Brad Fitzpatrick
parent 4a0dad211c
commit 1058aecf61

View File

@ -286,6 +286,7 @@ func (t *Transport) onceSetNextProtoDefaults() {
if v := rv.Field(0); v.CanInterface() {
if h2i, ok := v.Interface().(h2Transport); ok {
t.h2transport = h2i
return
}
}
}