Commit Graph

947 Commits

Author SHA1 Message Date
Brad Fitzpatrick
35028a49ca http2: don't ignore DATA padding in flow control
http://httpwg.org/specs/rfc7540.html#rfc.section.6.1 says:

> The entire DATA frame payload is included in flow control, including
> the Pad Length and Padding fields if present.

But we were just ignoring the padding and pad length, which could lead
to clients and servers getting out of sync and deadlock if peers used
padding. (Go never does, so it didn't affect Go<->Go)

In the process, fix a lingering bug from golang/go#16481 where we
didn't account for flow control returned to peers in the stream's
inflow, despite sending the peer a WINDOW_UPDATE.

Fixes golang/go#16556
Updates golang/go#16481

Change-Id: If7150fa8f0da92a60f34af9c3f754a0346526ece
Reviewed-on: https://go-review.googlesource.com/25382
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-08-01 02:38:47 +00:00
Brad Fitzpatrick
6a513affb3 http2: return flow control for closed streams
For both the server and the transport, return connection-level flow control in
two cases: 1) when a stream is closed with buffered data not read by the user,
or 2) when a DATA frame arrives but there the stream has since been closed.

Fixes golang/go#16481

Change-Id: Ic7404180ed04a2903e8fd6e9599a907f88b4f72e
Reviewed-on: https://go-review.googlesource.com/25231
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-07-26 22:16:01 +00:00
Brad Fitzpatrick
9f2c271364 http2: fix data race on cc.singleUse
NewClientConn starts a goroutine (which reads cc.singleUse at start),
so it's not safe to set cc.singleUse after calling NewClientConn.

Change-Id: I5c28db15e8e8fd8ec5ef0e04b7f81e61efbd873e
Reviewed-on: https://go-review.googlesource.com/25230
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-26 08:29:38 +00:00
Mikio Hara
4d38db7685 route: don't crash or hang up with corrupted messages
Fixes golang/go#16438.

Change-Id: I2a97e57cae298e8eecdd5637c9e03493a449fc62
Reviewed-on: https://go-review.googlesource.com/25070
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-07-20 08:41:39 +00:00
Brad Fitzpatrick
3797cd8864 http2: make Transport prefer HTTP response header recv before body write error
Fixes flakes like:
https://build.golang.org/log/56e0561f9f6a740b75538692a1c3288f08949dd0

I reproduced the flake above with a time.Sleep(50 * time.Millisecond)
before ClientConn.RoundTrip's final for{select{...}} loop (to give
multiple channels time to become readable on the first select), and
then ran (on linux/amd64) with:

go test -v -run=TestTransportReqBodyAfterResponse_403 -count=50 -race

Before, many failed. With this CL it never fails. (crosses fingers)

Fixes golang/go#16102 (again)

Change-Id: I93fde46846cd09445e53c140e9668382965d95c5
Reviewed-on: https://go-review.googlesource.com/24984
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-07-17 22:45:10 +00:00
Brad Fitzpatrick
be28236b90 http2: make Transport treat "Connection: close" the same as Request.Close
Both "Connection: close" and Request.Close should mean the same thing:
to use the same connection.

The Request.Close case was fixed in https://golang.org/cl/24810 for
Request.Close but I forgot about "Connection: close". Unify the code.

Fixes flaky failures such as:
https://storage.googleapis.com/go-build-log/6adb97bd/freebsd-amd64-gce101_5c331c2a.log
(noticed by Ian on a https://golang.org/cl/24977 trybot run)

Updates golang/go#15612

Change-Id: I3ab5175b8bc528ee240370c906b00cc691651bb4
Reviewed-on: https://go-review.googlesource.com/24982
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-17 05:54:02 +00:00
Ian Lance Taylor
45b61eaf18 context/ctxhttp: if context is canceled, return its error
This preserves the promise that Do will return the context's error.

Fixes golang/go#16381

Change-Id: I0db49b175736a695199b38819b4ff97b83d9c5ed
Reviewed-on: https://go-review.googlesource.com/24977
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-07-16 21:44:27 +00:00
Brad Fitzpatrick
e90d6d0afc http2: fix flaky TestTransportResPattern_* tests
The test's server was replying with the stream closure before reading
the test client's request body. This should in theory be handled
better (and golang/go#16029 will be kept open to track it), but that's not
what this test was trying to test anyway.

Instead, make the test do things in the expected order so it can
continue to test its original subject reliably. (It was trying to test
all the orders of optional & optionally fragmented headers in responses.)

Updates golang/go#16029 (flaky http2 TestTransportResPattern_*)
Updates golang/go#11811 (subrepos need to be green)

Change-Id: I631730fce5dad598120bb2d1ea8895e39255d711
Reviewed-on: https://go-review.googlesource.com/24970
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-15 18:41:38 +00:00
Brad Fitzpatrick
a728288923 http2: make Transport honor Request.Close more aggressively
The old support for Request.Close was optimistic, but there were still
windows where two connections should share the same
connection. Instead, support it earlier and more explicitly.

This fixes a flaky test on FreeBSD which was probably only flaky due
to unfortunate scheduling/timing.

Change-Id: I2eed9e59116356257e1b7df7a034b1c5d5f6533a
Reviewed-on: https://go-review.googlesource.com/24810
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-07-13 21:26:39 +00:00
Brad Fitzpatrick
c9a3c546a1 http2: fix flaky TestTransportReqBodyAfterResponse_403
Removes a time.Sleep from a test.

Fixes golang/go#16102

Change-Id: Ic1079ad3312d2dcfde4cc16dd0ee9661e1e509f2
Reviewed-on: https://go-review.googlesource.com/24903
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2016-07-13 19:45:06 +00:00
Brad Fitzpatrick
f841c39de7 context/ctxhttp: add a specialized minimal version for Go 1.7
Change-Id: Ib174b984184191d803364c684070346a105ef4b5
Reviewed-on: https://go-review.googlesource.com/24620
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dave Day <djd@golang.org>
2016-07-07 22:37:29 +00:00
Nigel Tao
7864c9eef8 publicsuffix: update table to latest list from publicsuffix.org.
Also drop some leading zeroes in in the generated table.go file. Its
size drops from 140K to 124K. After gzipping, this is from 46K to 45K.
It's not a huge win, but it's a win.

Change-Id: Ib1c13fb8b58b4eca231b5d74c15297f245c62e7c
Reviewed-on: https://go-review.googlesource.com/24753
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-07-07 05:36:24 +00:00
Jonathan Rudenberg
b400c2eff1 http2: add additional blacklisted ciphersuites
TLS_RSA_WITH_AES_128_GCM_SHA256 and TLS_RSA_WITH_AES_256_GCM_SHA384
are also blacklisted in RFC 7540 Appendix A.

Because they are were implemented in Go 1.6, the isBadCipher
function has been moved into the version-tagged files so that the
repo doesn't break for Go 1.5 users.

Change-Id: If8ca058ede51e9a4a337ce8d645cfd9f370d49b4
Reviewed-on: https://go-review.googlesource.com/24214
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-06-30 22:09:10 +00:00
Brad Fitzpatrick
8e573f4005 http2: merge multiple GOAWAY frames' contents into error message
The http2 spec permits multiple GOAWAY frames if the conditions
change.  Merge their error messages together, preferring the first
non-empty debug data, and first non-ErrCodeNo error code.

Updates golang/go#14627

Change-Id: I073b9234d71f128ed0713f09a24c728b56d7c1ae
Reviewed-on: https://go-review.googlesource.com/24600
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-29 22:54:44 +00:00
Brad Fitzpatrick
ef2e00e88c http2: make Transport return server's GOAWAY error back to the user
Updates golang/go#14627 (fixes once bundled into std)

Change-Id: Iae91d165df749e06549a25f9664ee416f115573f
Reviewed-on: https://go-review.googlesource.com/24560
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-28 23:24:14 +00:00
Michael Hudson-Doyle
04557861f1 webdav: skip test that fails with gccgo
Change-Id: Ibcb2fbb6a016046dd67e92372376f0f639979e37
Reviewed-on: https://go-review.googlesource.com/24484
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-06-27 22:15:07 +00:00
Michael Hudson-Doyle
e445b19913 ipv4: add support for ppc (using gccgo)
Change-Id: I06f6ade2788e8cc86d3027af60ec33800092a6d1
Reviewed-on: https://go-review.googlesource.com/24485
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
2016-06-27 00:46:36 +00:00
Michael Hudson-Doyle
641602e72f ipv6: add support for ppc (using gccgo)
Change-Id: I1e81ca4bd1396b4ddd0c8eb7368ebceb99409318
Reviewed-on: https://go-review.googlesource.com/24486
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
2016-06-27 00:46:01 +00:00
Gyu-Ho Lee
bc3663df0a http2: fix typo in ReadFrame
This fixes a minor typo in frame.go ReadFrame.

Change-Id: Idb6d4d412a6bc27fa8afb6f03007e974cd98d0c9
Reviewed-on: https://go-review.googlesource.com/24310
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2016-06-21 21:56:08 +00:00
Matt Layher
7c71ca708c bpf: implement LoadExtension and ExtLen for VM
Change-Id: I29487b0c1fdea97b5c35d22b4f7c23e11e7ceeed
Reviewed-on: https://go-review.googlesource.com/24272
Reviewed-by: David Anderson <danderson@google.com>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
2016-06-20 21:42:44 +00:00
Mikio Hara
8bf2b39827 bpf: fix a typo
Change-Id: I5b865483bf6a8bba07934ae3b1ff5bbbf6dd6a00
Reviewed-on: https://go-review.googlesource.com/24240
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Tom Heng <zhm20070928@gmail.com>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
2016-06-19 23:45:41 +00:00
Matt Layher
1961d9def2 bpf: add Go implementation of virtual machine
Fixes golang/go#16055.

Change-Id: I80437e2895b0f2bf23e090dec29bd20c2900db9a
Reviewed-on: https://go-review.googlesource.com/24136
Reviewed-by: David Anderson <danderson@google.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2016-06-18 00:31:17 +00:00
Nigel Tao
d7bf3545bb webdav: respect the Handler.Prefix in confirmLocks.
Fixes golang/go#15967.

Change-Id: I24ffebbe70d15cfd8697c843972f4f1669670f17
Reviewed-on: https://go-review.googlesource.com/24023
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-16 00:25:24 +00:00
Nigel Tao
3f122ce3db publicsuffix: strip generated comments; automatically scrape git version.
Also follow the "go generate" convention, and have the generation
command be a bare "go run gen.go" without any need for explicit flags.

Stripping the for-debugging comments shrinks the generated table.go file
from 538K to 139K.

Also update table to latest list from publicsuffix.org:
revision ea9f4f9c51f5bfc5c85a41a5637ab671c07c542a
(2016-05-31T18:30:56Z)

Change-Id: Ib59366106e0142fd65a2102e73d6a9a29e53930e
Reviewed-on: https://go-review.googlesource.com/23930
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-09 05:12:31 +00:00
Mikio Hara
313cf39d4a http2: fix data race on pipe
Fixes golang/go#15999.

Change-Id: I20793ce717c768557c4942ff6be4e77c23ab201c
Reviewed-on: https://go-review.googlesource.com/23880
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-08 02:50:06 +00:00
Andrew Gerrand
154d9f9ea8 http2: consider buffered data when doing stream flow control
Fixes golang/go#15930

Change-Id: Ib5d2f57361d52364edb29df25ec9a498c3088781
Reviewed-on: https://go-review.googlesource.com/23812
Reviewed-by: Aaron Jacobs <jacobsa@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2016-06-07 04:32:31 +00:00
Tom Bergan
c4c3ea7191 http2: GotFirstResponseByte hook should only fire once
Fixes golang/go#15777

Change-Id: I6fd8a8fdea051f3c02272cc15af7f0bcdfb5d745
Reviewed-on: https://go-review.googlesource.com/23526
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
2016-05-31 15:01:52 +00:00
Dave Cheney
7553b97266 websocket: fix Read behaviour in hybiFrameReader.Read
The contract for Read specifies that a caller should process n bytes of
data before handling an error value. The previous implementation may
have discarded the final data read from the underlying reader if err
was non nil.

Change-Id: I81547cd9ea62c4060f79523679beed6bbc6ccd95
Reviewed-on: https://go-review.googlesource.com/23534
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-31 06:23:09 +00:00
H. İbrahim Güngör
30db96677b webdav: set 'getlastmodified' live property for directories
WebDAV clients can't sort folders by date because 'getlastmodified' live
property is not set.

Fixes golang/go#15334.

Change-Id: Ie56fcf8ae98173878e0972c0f9401151953334ff
Reviewed-on: https://go-review.googlesource.com/23422
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-05-27 00:43:53 +00:00
Mikio Hara
dfd9ed699e http2: fix nits in test
Change-Id: Ib988bde8f8ff5719fd24bf63bd5ece648602dbd8
Reviewed-on: https://go-review.googlesource.com/23460
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-26 04:20:37 +00:00
ayanamist
b3e9c8fbe0 http2: allow http scheme for http2
The existing transport implementation limit scheme to https, so
simple h2c can not be used, if we loose the limit to http scheme,
it works well with existing h2c server support.

Fixes golang/go#15830

Change-Id: Icfe65d72b3e6fb41f69019539fb5b86144814378
Reviewed-on: https://go-review.googlesource.com/23181
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-25 21:22:51 +00:00
Brad Fitzpatrick
0c607074ac http2: prevent Server from sending status 100 header after anything else
Since Go's HTTP/2 Handlers can read & write concurrently, it was
previously possible for a Handler to get an HTTP Request with "Expect:
100-continue" and to first Write some data, then read some data, and
the read of the data was triggering the server's automatic
"100-continue" response path.  But if the server had already replied
with a non-100 HEADERS frame, sending a HEADERS frame with :status 100
later is in violation of the spec.

Fix it by tracking whether we've already replied with something, and
ignoring the 100-continue when it's inappropriate.

Updates golang/go#14030

Change-Id: I6745ba0f257a31eaf63816e4263cadbef5a896a2
Reviewed-on: https://go-review.googlesource.com/23311
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-21 00:25:09 +00:00
Brad Fitzpatrick
4d07e8a493 http2: let handlers close Request.Body without killing streams
Also, fix a Transport goroutine leak if the transport is still trying
to write its body after the stream has completed.

Updates golang/go#15425 (fixes after bundle into std)

Change-Id: Id14d9360d012f53a963ec1999ef88fc592978b80
Reviewed-on: https://go-review.googlesource.com/23287
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-20 20:56:38 +00:00
Brad Fitzpatrick
8a52c78636 http2: fix Transport.CloseIdleConnections when http1+http2 are wired together
Go 1.6+ wires up its http.Transport values to http2 with ConfigureTransport.
ConfigureTransport sets the connection pool to a "noDialClientConnPool"
type. But the Transport.CloseIdleConnections implementation was specifically
looking for a concrete type. Look for an interface instead.

Updates golang/go#14607 (needs bundle into the main repo before fix)

Change-Id: I6ad23b6facab5d3c2cbe71a1809a52794375d803
Reviewed-on: https://go-review.googlesource.com/23258
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-20 03:00:43 +00:00
Brad Fitzpatrick
202ff482f7 http2: delay sending request body in Transport if 100-continue is set
In Go 1.6, the HTTP/1 client got Transport.ExpectContinueTimeout.

This makes the HTTP/2 client respect a Request's "Expect:
100-continue" field and the Transport.ExpectContinueTimeout
configuration.

This also makes sure to call the traceWroteRequest hook if the server
replied while we're still writing the request, since that code was
in the same spot and it couldn't be trivially separated.

Updates golang/go#13851 (fixed after integrating it into std)
Updates golang/go#15744

Change-Id: I67dfd68532daa6c4a0c026549c6e5cbfce50e1ea
Reviewed-on: https://go-review.googlesource.com/23235
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-20 02:53:00 +00:00
Brad Fitzpatrick
5916dcb167 http2, lex/httplex: make Transport reject bogus headers before sending
The http2.Transport was able to send bogus header keys & values.
This changes rejects them earlier, before they hit the wire.

In the process, mirror the lexical rules from the http package to x/net.
Maintaining two copies has gotten increasingly annoying.

Updates golang/go#14048

Change-Id: I20abcdeea92e7dc8706a1bbd60688ee8843a2b12
Reviewed-on: https://go-review.googlesource.com/23229
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-19 01:54:56 +00:00
Brad Fitzpatrick
3c5cb154b0 http2: reject more trailer values
Updates golang/go#14188

Change-Id: Ic274841422fcb6179c0a782956bbfa336d27f1e1
Reviewed-on: https://go-review.googlesource.com/23230
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-19 01:52:22 +00:00
Brad Fitzpatrick
8aacbecd63 http2: with Go 1.7 set Request.Context in ServeHTTP handlers
And act the same as HTTP/1.x in Go 1.7.

Updates golang/go#15134

Change-Id: Ib64dd82cc5f8dd60e1680525f664d5b72be11fc6
Reviewed-on: https://go-review.googlesource.com/23220
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-18 21:19:18 +00:00
Brad Fitzpatrick
3b993948b6 http2: when using Go 1.7, make Transport use httptrace hooks
Updates golang/go#12580

Change-Id: I95d7206a8fde494f88288b381814a5d72d42df5e
Reviewed-on: https://go-review.googlesource.com/23205
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-18 15:10:36 +00:00
Mikio Hara
76e74a3365 ipv6: add support for linux/s390x
Change-Id: Ia431a6cfc53a66b20307f1e54b17f5bbceee02e3
Reviewed-on: https://go-review.googlesource.com/23193
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-18 03:10:44 +00:00
Mikio Hara
a71ada68b9 ipv4: add support for linux/s390x
Change-Id: I6789d04215f23dfb9fe07a90f78e80eadfcb906c
Reviewed-on: https://go-review.googlesource.com/23192
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-18 03:10:31 +00:00
Mikio Hara
fac978cc75 route: fix typos in test
Change-Id: Id0558e3ee71b393e0366c1ae5e022d657fec08f0
Reviewed-on: https://go-review.googlesource.com/23191
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-18 03:10:18 +00:00
David Anderson
ef00b378c7 ipv6: support attaching packet filters to PacketConn.
Fixes golang/go#14974

Change-Id: I58c41acf29329aedf61b9ca59eb271e4536c80ea
Reviewed-on: https://go-review.googlesource.com/23107
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2016-05-15 06:10:11 +00:00
David Anderson
58b2fb074e ipv4: support attaching packet filters to PacketConn/RawConn.
Updates golang/go#14974

Change-Id: I80da378a788d5d826b3b79ab308372231c012391
Reviewed-on: https://go-review.googlesource.com/23105
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-15 02:52:58 +00:00
Mikio Hara
30be488e91 route: new package
This change introduces a package that provides the basic manipulation of
routing facilities on BSD variants.

Unlike the existing APIs in syscall package of standard library, the
package tries to provide operating system and its architecture agnostic
APIs. At present, the package supports any version of Darwin, any
version of DragonFly BSD, FreeBSD 7 through 11, NetBSD 6 and above, and
OpenBSD 5.6 and above.

Updates golang/go#14724.

Change-Id: Id964ea22dec491ddac3776e3a8c8c10f140f96ac
Reviewed-on: https://go-review.googlesource.com/22446
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-14 01:16:38 +00:00
Carl Mastrangelo
6050c11192 http2/hpack: forbid excess and invalid padding in hpack decoder
This change fixes a few bugs in the HPACK decoder:
 * Excess trailing padding is treated as an error per the HPACK Spec
     section 5.2
 * Non EOS prefix padding is treated as an error
 * Max length is now enforced for all decoded symbols

The idea here is to keep track of the decoded symbol length, rather
than the number of unconsumed bits in cur.  To this end, nbits has
been renamed cbits (cur bits), and sbits (sym bits) has been
introduced.  The main problem with using nbits is that it can easily
be zero, such as when decoding {0xff, 0xff}.  Using a clear moniker
makes it easier to see why checking cbits > 0 at the end of the
function is incorrect.

Fixes golang/go#15614

Change-Id: I1ae868caa9c207fcf9c9dec7f10ee9f400211f99
Reviewed-on: https://go-review.googlesource.com/23067
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-13 23:09:52 +00:00
Brad Fitzpatrick
96dbb961a3 http2: make Transport use Request.Context, set Response.Uncompressed
Go 1.7 introduces Request.Context and Response.Uncompressed. Use them
both in the http2 Transport when building for Go 1.7.

Tests are in the main repo.

Updates golang/go#15366
Updates golang/go#15134

Change-Id: I4b78a2710b6cf30c769c7f85cea15ecde653a317
Reviewed-on: https://go-review.googlesource.com/23002
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-10 17:26:03 +00:00
Ian Lance Taylor
2a35e68658 context: correct spelling of TODO in comment
Change-Id: I62bfc730643cb0756fc67f3c5cf73029b75c07bb
Reviewed-on: https://go-review.googlesource.com/22884
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-06 21:07:50 +00:00
Mikio Hara
7e42c0e132 ipv4: don't fail test on big endian machine
Change-Id: I7fc0634dd1c7cd49b0f3aa2d84a83e783f6687a1
Reviewed-on: https://go-review.googlesource.com/22678
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-05 21:58:21 +00:00
Mikio Hara
9723ea673d icmp: don't fail test on big endian machine
Change-Id: I5ceede6cf0aa4fcdbf59c39e1aff9826874f2710
Reviewed-on: https://go-review.googlesource.com/22677
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-05 21:57:10 +00:00