Commit Graph

1237 Commits

Author SHA1 Message Date
Brad Fitzpatrick
fc492d2e10 http/httpproxy: fix build on Go 1.8
Go 1.8 doesn't have t.Helper.

Fix the row of red on the dashboard.

Change-Id: I85d4bb9fe38e989dc3b6a4e99705599745b83cef
Reviewed-on: https://go-review.googlesource.com/80140
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-28 02:42:22 +00:00
Tom Bergan
e6a4aa30b6 http2: fix leak in activeRes by removing activeRes
AFAICT, activeRes serves no real purpose. It is used in just two ways:

- To reduce the number of calls to closeIfIdle, which reduces the number
  of acquires of cc.mu when there are many concurrent streams. I dug
  through the CL history and could not find any benchmarks showing that
  this is necessary.

- To avoid redundant calls to cs.bufPipe.CloseWithError(err) when a read
  loop is shutdown. This is unnecessary, since redundant CloseWithError
  calls are ignored.

Since there isn't a good reason to have activeRes, the simplest way to
fix the leak is to remove activeRes entirely.

Updates golang/go#21543

Change-Id: I1d1d2dc6c946425a2772c8bf71436707021ac269
Reviewed-on: https://go-review.googlesource.com/80137
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-28 01:37:49 +00:00
Tom Bergan
db473f6b23 http2: don't autodetect Content-Type when the response has an empty body
This change was originally made in https://golang.org/cl/46631, however,
that change was applited to net/http/h2_bundle.go instead of x/net/http2.

Updates golang/go#20784

Change-Id: I947fa4c19f3efc400856573768140bece28276a2
Reviewed-on: https://go-review.googlesource.com/80135
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-28 00:57:53 +00:00
Brad Fitzpatrick
d3b7d8cc97 http2: panic on invalid WriteHeader status code
Tests are in net/http. (upcoming CL)

Updates golang/go#22880

Change-Id: Ie94693ad4e14f0c07926a0b6c7827caace94a0aa
Reviewed-on: https://go-review.googlesource.com/80076
Reviewed-by: Tom Bergan <tombergan@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-27 23:23:00 +00:00
Tom Bergan
80e70a3f77 http2: fix race on ClientConn.maxFrameSize
This fixes TestTrailersClientToServer_h2. Before this CL, the following
command reliably fails. With this CL merged into net/http, the following
command reliably succeeds.

go test -race -run=TestTrailersClientToServer_h2 -count 1000 net/http

Updates golang/go#22721

Change-Id: I05d1504c60854fcf3ae9531f36a126e94b00f0b7
Reviewed-on: https://go-review.googlesource.com/79238
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
2017-11-27 21:35:52 +00:00
Brad Fitzpatrick
3e050b2a66 http2: don't crash in Transport on server's DATA following bogus HEADERS
In golang/go#22880, our http2 server was sending a HEADERS response
without a :status header. Our client code correctly returned an error
from RoundTrip, but we forgot to clean up properly, and then
subsequently crashed on a DATA frame.

This fixes the Transport crash. A fix for the server bug will come separately.

Change-Id: Iea3bcf4a8c95963c8b5e2b6dd722177607bd1bc1
Reviewed-on: https://go-review.googlesource.com/80056
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-11-27 21:30:32 +00:00
Roger Peppe
c7086645de http/httpproxy: new package
This factors out the HTTP proxy functionality from net/http,
with a view to vendoring it into net/http later.

See discussion in https://go-review.googlesource.com/c/go/+/68091

Change-Id: I8df8a92a13bca03504edd24b71a9a184f290b87d
Reviewed-on: https://go-review.googlesource.com/76910
Reviewed-by: roger peppe <rogpeppe@gmail.com>
2017-11-23 08:18:56 +00:00
Brad Fitzpatrick
fb018015d5 http2: don't log about timeouts reading client preface on new connections
Updates golang/go#18776

Change-Id: I7568f779e2b86c72c54c8744c08cc02988dde55b
Reviewed-on: https://go-review.googlesource.com/79498
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-11-22 21:47:05 +00:00
Frederic Guillot
9dfe398356 net/html: add missing package name in doc example
This code snippet should contains the prefix "html" like
other examples to be consistent.

Change-Id: I32428452625c016894aebc2011cde2dd614e6ed9
Reviewed-on: https://go-review.googlesource.com/77830
Reviewed-by: Gabriel Aszalos <gabriel.aszalos@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Gabriel Aszalos <gabriel.aszalos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-15 15:19:08 +00:00
Anmol Sethi
a337091b05 http2: require either ECDSA or RSA ciphersuite
The HTTP/2 RFC does indeed mandate TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
but in practice, people are also using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
becuase they are only using an ECDSA certificate. This is the case in acme/autocert.

It doesn't make sense to enforce only RSA in cipher suites if it will
never be used because they are using a ECDSA certificate.

Change-Id: I86dac192a3eb9b74e4268310a3b550b3bd88a37f
Reviewed-on: https://go-review.googlesource.com/30721
Reviewed-by: Tom Bergan <tombergan@google.com>
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-07 18:48:41 +00:00
Tom Bergan
01c190206f http2: fix transport data race on reused *http.Request objects
Based on golang/go#19653, it should be possible to reuse an http.Request
object after the outstanding request has completed. This CL fixes a race
in the http/2 library that occurs when a caller tries to reuse an
http.Request just after the request completed.

The new test failed with -race before this CL and passes after this CL.
Verified with -count 10000.

Updates golang/go#21316

Change-Id: I014cf9cefd0dd21f6f41763ba554d23ddc7fca40
Reviewed-on: https://go-review.googlesource.com/75530
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-02 19:10:33 +00:00
Marcel van Lohuizen
49e6db1c9e idna: bug fix imported from x/text
See CL 73730: avoid memory leak in validation codes
Upstream at 8253218a.

Change-Id: I3d4860989c8e057f9cc4c9087a78c9c800c5aa7d
Reviewed-on: https://go-review.googlesource.com/74954
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-02 17:05:40 +00:00
Tom Bergan
ea0da6f35c http2: remove afterReqBodyWriteError wrapper
There was a case where we forgot to undo this wrapper. Instead of fixing
that case, I moved the implementation of ClientConn.RoundTrip into an
unexported method that returns the same info as a bool.

Fixes golang/go#22136

Change-Id: I7e5fc467f9c26fb74b9b83f2b3b7f8882645e34c
Reviewed-on: https://go-review.googlesource.com/75252
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-01 23:00:25 +00:00
Ben Burkert
c73622c772 dns/dnsmessage: add AppendPack method to Message
Add an AppendPack method to Message that appends the message data into a
byte buffer. Reusing a buffer allows for a reduction in allocations.

name          time/op
Pack-8        5.04µs ± 1%
AppendPack-8  4.95µs ± 2%

name          alloc/op
Pack-8        6.22kB ± 0%
AppendPack-8  5.71kB ± 0%

name          allocs/op
Pack-8          21.0 ± 0%
AppendPack-8    20.0 ± 0%

Change-Id: I8bb6b07787cf2ba9ef32e1e60a3003a585ec55be
Reviewed-on: https://go-review.googlesource.com/45274
Reviewed-by: Ian Gudger <igudger@google.com>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-27 10:38:34 +00:00
Russ Cox
7b572d500b route: work around macOS kernel bug
The macOS kernel reliably crashes in a repeated TestRouteMessage.
Putting some extra padding into the request buffer avoids the crash.
This will do as workaround; the kernel bug will be reported to Apple separately.

Fixes golang/go#22456.

Change-Id: I789d3d57fbc511016d9f4a3fa7662d6c7642f137
Reviewed-on: https://go-review.googlesource.com/73690
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-26 23:40:51 +00:00
Marcel van Lohuizen
4b14673ba3 idna: updated to Unicode 10.0.0
Generated from x/text.

Significant changes in the interpretation
of the Bidi rule as well as sharpening of
the leading dot rules, among other things.

Issue golang/go#21471

Change-Id: I8649a4090e2bc530aad4412210a3de344fb2eab6
Reviewed-on: https://go-review.googlesource.com/63951
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-10-24 11:51:30 +00:00
Michael Fraenkel
92447d5589 http2: Discard data reads on HEAD requests
If a server returns a DATA frame while procesing a HEAD request, the
client will discard the data.

Fixes golang/go#22376

Change-Id: Ief9c17ddfe51cc17f7f6326c87330ac9d8b9d3ff
Reviewed-on: https://go-review.googlesource.com/72551
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-10-23 21:56:55 +00:00
Francisco Rojas
5561cd9b43 context: mention standard library version in package comment
Fixes golang/go#22322

Change-Id: I1f0c62ce1c247b583de51faef8722d07e627b441
Reviewed-on: https://go-review.googlesource.com/72570
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-23 17:40:46 +00:00
Tom Bergan
cd69bc3fc7 http2: always delay closing the connection after sending GOAWAY
Currently, we close the connection immediately after sending a GOAWAY
frame if all outstanding responses have been completely sent. However,
the client may have had requests in-flight at that time which have been
queued in the kernel receive buffer. On both Windows and Linux, if the
connection is close()'d when the receive buffer is not empty, the kernel
sends RST. This has the effect of aborting both sides of the connection,
meaning the client may not actually receive all responses that were sent
before the GOAWAY.

Instead, we should delay calling close() until after the receive buffer
has been drained. We don't want to delay indefinitely, which means we
need some kind of timeout. Ideally that timeout should be about 1 RTT +
epsilon, under the assumption that the client will not send any more
frames after receiving the GOAWAY. However, 1 RTT is difficult to
measure. It turns out we were already using a 1 second delay in other
cases, so we reuse that same delay here.

Note that we do not call CloseWrite() to half-close the underlying TLS
connection. This seems unnecessary -- GOAWAY is effectively a half-close
at the HTTP/2 level.

Updates golang/go#18701 (fixes after it's bundled into net/http)

Change-Id: I4d68bada6369ba95e5db02afe6dfad0a393c0334
Reviewed-on: https://go-review.googlesource.com/71372
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2017-10-20 20:44:01 +00:00
Joe Kyo
aabf50738b proxy: fix typos in comments
Change-Id: I7091af7efe71d46a0f55fd8341afcaa76073adaf
Reviewed-on: https://go-review.googlesource.com/71630
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-10-19 16:49:06 +00:00
Anand K. Mistry
1087133bc4 net/http2: reset client stream after processing response headers
When a client receives a HEADER frame with a END_STREAM flag,
clientConn.streamByID closes the stream before processing the headers
which may contain a full non-error response. This causes the request's
bodyWriter cancelation to race with the response.

Closing the stream after processing headers allows the response to be
available before the bodyWriter is canceled.

Updates golang/go#20521

Change-Id: I70740e88f75240836e922163a54a6cd89535f7b3
Reviewed-on: https://go-review.googlesource.com/70510
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-16 23:55:12 +00:00
Mikio Hara
a04bdaca5b internal/socket: make ipv4, ipv6 and icmp work again on android
On android, runtime.GOOS returns "android" instead of "linux".

Fixes golang/go#22115.

Change-Id: Idd24d5602f8fa9be1fca0b64bd8966849ea2b5e7
Reviewed-on: https://go-review.googlesource.com/67770
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-04 03:46:48 +00:00
Mikio Hara
4f8c76a975 internal/socket: don't crash with empty Message.Buffers
Fixes golang/go#22117.

Change-Id: I0d9c3e126aaf97cd297c84e064e9a521ddac626f
Reviewed-on: https://go-review.googlesource.com/67750
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-04 03:46:34 +00:00
Kevin Burke
0a9397675b README: flush out description
Move the README to README.md so Gerrit can render it; currently
Gerrit only renders files named exactly "README.md" (for example at
https://go.googlesource.com/go).

Add more links to the README explaining how to file issues,
how to submit code changes, where to download the code to and
how to get it. Hopefully this should help people who go to
https://go.googlesource.com/net or https://github.com/golang/net
figure out how to get started with development.

Change-Id: I4eb54f2b210e4f028c9f00955ff19b55643315e6
Reviewed-on: https://go-review.googlesource.com/49850
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2017-09-27 05:51:02 +00:00
Kunpei Sakai
278c6cf336 html/atom: sync html table with the current whatwg spec
Some elements and attributes have been removed from the spec,
but are kept here for backwards compatibility.

Also, this makes gen.go support go:generate and write contents into
target files directly.

Finally, this makes `go generate` work on an entire directory.

Change-Id: I8d41840eec69eec1ef08527d8d71786612a3121d
Reviewed-on: https://go-review.googlesource.com/65152
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-09-26 18:29:41 +00:00
Joe Kyo
0744d001aa proxy: add mention of RFC 1929 for SOCKS5
RFC 1929 describes the SOCKS5 username/password authentication method.
The proxy package implements this method, but doesn't mention RFC 1929.
This change adds mention of RFC 1929.

Change-Id: I30487fb41c1baa16b6ee8a99210168a597e5cb65
Reviewed-on: https://go-review.googlesource.com/60870
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Avelino <t@avelino.xxx>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-22 01:12:44 +00:00
namusyaka
b60f3a9210 html: add main and keygen as special element
Also, the isindex element has been remove from specification,
so this commit adds a comment about it.

Change-Id: I79a9b1eb9dae8274e2ca498ab73b2e73521d54e9
Reviewed-on: https://go-review.googlesource.com/64230
Reviewed-by: Tom Bergan <tombergan@google.com>
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-20 23:43:30 +00:00
Volker Dobler
43a6ada385 publicsuffix: allow to encode up to 1023 children in the table
The number of children (494) got pretty close to the available maximum
number of children (511) in the table. This number increased over the
last year by roughly 65 indicating that we would run out of space in
the next three months. The other fields still have enough room left.
The following table show the growth over the last 1.5 years:

    # Commit Date Children TextOffset Length High Low
    b05061f 2017-09-18 494 28750 36 8407 8402
    859d1a8 2017-09-06 494 28750 36 8407 8402
    ddf80d0 2017-06-14 479 28411 36 8262 8257
    61557ac 2017-01-26 466 28023 36 8121 8120
    5695785 2016-10-20 434 27930 36 8135 8134
    07b5174 2016-08-11 424 27866 36 8062 8051
    7864c9e 2016-07-07 421 27811 36 8049 8038
    3f122ce 2016-06-09 417 27680 36 8029 8018
    d58ca66 2016-03-04 409 27059 36 7887 7886
    6c581b9 2016-02-01 406 26999 36 7868 7867
    78e1654 2016-01-20 405 26986 36 7863 7862

Given this rate of grow of max text offset it will overflow in 2021.
Thus use the last of the available 32 bits to encode more children.

Change-Id: I04db02100b202f220a0b4ee509f868db031fd8ab
Reviewed-on: https://go-review.googlesource.com/64330
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-09-20 23:39:49 +00:00
Avelino
411fb0e25f README: style syntax to markdown
Change-Id: I557b34aeabf0dc838f9c574966c2d12f02e41a19
Reviewed-on: https://go-review.googlesource.com/57332
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-09-20 22:13:49 +00:00
namusyaka
8351a756f3 all: fix article typos
a -> an

Change-Id: I7d0413396e51f16e0a83732a07a5536548e03506
Reviewed-on: https://go-review.googlesource.com/63992
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-15 14:21:06 +00:00
Volker Dobler
859d1a86bb publicsuffix: update table to latest list from publicsuffix.org
Update the list to revision 38b238d6324042f2c2e6270459d1f4ccfe789fba
(2017-08-28T20:09:01Z).

Change-Id: I80aca3aa21255176e0b6a4c3f8b1b755d0ee2c8e
Reviewed-on: https://go-review.googlesource.com/61890
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Run-TryBot: Nigel Tao <nigeltao@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-14 00:13:09 +00:00
Hiroaki Nakamura
b129b8e0fb idna: add test for domains containing non-ASCII dots
Change-Id: I1011371968c2a548378c7490212a39989a9de75e
Reviewed-on: https://go-review.googlesource.com/38284
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2017-09-12 21:17:36 +00:00
Mike Appleby
66aacef3dd http2: Respect peer's SETTINGS_MAX_HEADER_LIST_SIZE in ClientConn
Add a new peerMaxHeaderListSize member to ClientConn which records the
SETTINGS_MAX_HEADER_LIST_SIZE requested by the client's peer, and
respect this limit in (*ClientConn) encodeHeaders / encodeTrailers.

Attempting to send more than peerMaxHeaderListSize bytes of headers or
trailers will result in RoundTrip returning errRequestHeaderListSize.

Updates golang/go#13959

Change-Id: Ic707179782acdf8ae543429ea1af7f4f30e67e59
Reviewed-on: https://go-review.googlesource.com/29243
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-08-28 23:17:52 +00:00
Olivier Poitrey
57efc9c3d9 http2: reject DATA frame before HEADERS frame
If the server returns a DATA frame before a HEADERS frame, the client
must close the connection with a PROTOCOL_ERROR as describe in the
section 8.1.2.6.

The current implementation does not reject such sequence and panics
trying to write on the non-initialized bufPipe.

Fixes golang/go#21466

Change-Id: I55755dba259d026529a031e9ff82c915f5e4afae
Reviewed-on: https://go-review.googlesource.com/56770
Reviewed-by: Tom Bergan <tombergan@google.com>
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-24 17:44:28 +00:00
Tom Bergan
1c05540f68 http2: block RoundTrip when the Transport hits MaxConcurrentStreams
Currently if the http2.Transport hits SettingsMaxConcurrentStreams for a
server, it just makes a new TCP connection and creates the stream on the
new connection. This CL updates that behavior to instead block RoundTrip
until a new stream is available.

I also fixed a second bug, which was necessary to make some tests pass:
Previously, a stream was removed from cc.streams only if either (a) we
received END_STREAM from the server, or (b) we received RST_STREAM from
the server. This CL removes a stream from cc.streams if the request was
cancelled (via ctx.Close, req.Cancel, or resp.Body.Close) before
receiving END_STREAM or RST_STREAM from the server.

Updates golang/go#13774
Updates golang/go#20985
Updates golang/go#21229

Change-Id: I660ffd724c4c513e0f1cc587b404bedb8aff80be
Reviewed-on: https://go-review.googlesource.com/53250
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-08-09 00:05:01 +00:00
Brad Fitzpatrick
167db312be http2/h2i: add flag to dial one ip:port but SNI/:authority like it's another
Change-Id: I35049c37558ddedb9056278c9878f3e3fd6f7f76
Reviewed-on: https://go-review.googlesource.com/53640
Reviewed-by: Avelino <t@avelino.xxx>
Reviewed-by: Tom Bergan <tombergan@google.com>
2017-08-08 15:51:37 +00:00
Brad Fitzpatrick
090ebbdfc2 http2: fix Go 1.6 build
We still support Go 1.6 for a few more days. (it'd normally be dropped
after Go 1.9 final is out)

And maybe we'll need to make a special case for supporting it longer
than normal if gRPC needs to.

Change-Id: I78675f1ef26aa09436a70d0f8aa3a0958768dd14
Reviewed-on: https://go-review.googlesource.com/53641
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-08 06:10:10 +00:00
Tom Bergan
945ddfdd3b http2: retry requests after receiving REFUSED STREAM
RoundTrip will retry a request if it receives REFUSED_STREAM. To guard
against servers that use REFUSED_STREAM to encourage rate limiting, or
servers that return REFUSED_STREAM deterministically for some requests,
we retry after an exponential backoff and we cap the number of retries.

The exponential backoff starts on the second retry, with a backoff
sequence of 1s, 2s, 4s, etc, with 10% random jitter.

The retry cap was set to 6, somewhat arbitrarily. Rationale: this is
what Firefox does.

Updates golang/go#20985

Change-Id: I4dcac4392ac4a3220d6d839f28bf943fe6b3fea7
Reviewed-on: https://go-review.googlesource.com/50471
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-08-08 00:11:46 +00:00
Mikio Hara
f5079bd7f6 route: make DefaultAddr convey newly added information on OpenBSD
Also makes it possible to capture RTM_DESYNC messages when you have a
routing protocol implementation that requires to be aware of the
health condition of kernel RIB on OpenBSD.

Change-Id: Idd0c8c5e8f5ea72a4d56c9a46c137786bcda6354
Reviewed-on: https://go-review.googlesource.com/50191
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-07-26 08:36:32 +00:00
Mikio Hara
ab5485076f route: tweak comment on metric types
Change-Id: I9fb463a5b26e79073a3efc06eea13fd8fcdbf021
Reviewed-on: https://go-review.googlesource.com/50190
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-21 03:32:04 +00:00
Tom Bergan
7b7efd8000 http2/h2i: dump PUSH_PROMISE headers in h2i
Change-Id: Id891991e2b8371ad5744e7a0ec392d9d9bbeefdc
Reviewed-on: https://go-review.googlesource.com/50130
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-20 15:38:33 +00:00
Ian Gudger
02ac38e252 dns/dnsmessage: improve test coverage of skipping
Updates golang/go#16218

Change-Id: I613cf0a65d40a9823c83e0a547fbd48b2236d16e
Reviewed-on: https://go-review.googlesource.com/49630
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
2017-07-19 08:40:00 +00:00
Mikio Hara
aa7a5b9517 ipv6: update RFC number of IPv6 specification in docs
Change-Id: I38980c8463b7806c129024967713125acf663b82
Reviewed-on: https://go-review.googlesource.com/49791
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-07-19 08:39:41 +00:00
Mikio Hara
cabdc3af38 ipv4: update RFC number of IPv6 specification in docs
Change-Id: Ia3dbad890e3574b34370034fd4cb4bf96323bab3
Reviewed-on: https://go-review.googlesource.com/49790
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-07-19 08:39:33 +00:00
Daniela Petruzalek
5d0d7096b5 net: replaces "hostname" with "host name" in the proxy package
Updates golang/go#17613

Change-Id: I0b272c19c263f20084a936b5122bb3cfebacc752
Reviewed-on: https://go-review.googlesource.com/49750
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-18 21:25:42 +00:00
Rhys Hiltner
b3756b4b77 context: use Go 1.9 type alias for CancelFunc and Context
Since Go 1.7 started including the context package in the core
distribution, this package has been forwarding to the core package's
implementation to the best of its ability. Since type aliases are due
to be included in the Go 1.9 release, use them to forward more
completely.

Change-Id: I97b92cd34b3f4426f565bb3d115f119d3c83a1dd
Reviewed-on: https://go-review.googlesource.com/49020
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-16 17:46:42 +00:00
Tobias Klauser
f01ecb60fe http2: fix format argument warnings in tests
Fix two format argument warnings found by vet.

Change-Id: I01d55197c110c2a7486b1bd5dbd0afd74812e535
Reviewed-on: https://go-review.googlesource.com/48090
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-11 18:12:19 +00:00
Shi Han Ng
054b33e652 proxy: add support for ALL_PROXY and NO_PROXY
Fixes golang/go#13456

Change-Id: I0b938f824c47b29ac2026eff83e61c2f227a6cc1
Reviewed-on: https://go-review.googlesource.com/47530
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-06 00:57:53 +00:00
Mikio Hara
570fa1c913 ipv6: simplify tests and benchmarks
Change-Id: I248e5e5215960bceaba357d3d4a6e72191f955b1
Reviewed-on: https://go-review.googlesource.com/47372
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2017-07-04 09:14:38 +00:00
Mikio Hara
e1ae248e8a ipv4: simplify tests and benchmarks
Change-Id: I588bc65b0052efb12b3b7bc2267deedcdad029ce
Reviewed-on: https://go-review.googlesource.com/47371
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2017-07-04 09:14:29 +00:00