Commit Graph

1501 Commits

Author SHA1 Message Date
Marcel van Lohuizen
0deb6923b6 idna: update tables to Unicode 12
Change-Id: Iccaeb8f986263aacda9b10c6a945c2dddbdec79f
Reviewed-on: https://go-review.googlesource.com/c/net/+/204498
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-11-01 17:50:33 +00:00
Brad Fitzpatrick
fe3aa8a452 ipv4: use unsafe.Sizeof on struct size, not pointer size
Fix for CL 203400.

Change-Id: Ia0006cdeff4992a218c7a355bd83354138706833
Reviewed-on: https://go-review.googlesource.com/c/net/+/203777
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-28 08:55:09 +00:00
Lars Lehtonen
53de4c7853 http2: fix test goroutine
This PR fixes the `TestTransportAbortClosesPipes()` test, which was calling `T.Fatal()` from inside a goroutine. `testing.T.Fatal()` is a convenience function that calls `testing.T.Log()` before `testing.T.FailNow()`.

From the godoc for `testing.T.FailNow()`:

>   FailNow must be called from the goroutine running the test or benchmark function, not from other goroutines created during the test. Calling FailNow does not stop those other goroutines.

Change-Id: I34d13fc5a14be8b00bee7eae590781bb1ef3ae55
GitHub-Last-Rev: c3929733c5
GitHub-Pull-Request: golang/net#56
Reviewed-on: https://go-review.googlesource.com/c/net/+/203479
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-27 23:36:14 +00:00
Cuong Manh Le
d64ee3fa51 ipv4: fix unsafe pointer conversion in parseInterface
Fixes golang/go#35174

Change-Id: I01ae0ec25c90da0d05b1b262b33a32233f88260f
Reviewed-on: https://go-review.googlesource.com/c/net/+/203400
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-27 21:20:02 +00:00
Dmitri Goutnik
83d349e8ac ipv4, ipv6: add support for freebsd/arm64
Updates golang/go#35183

Change-Id: I3d820a1638526197ca7b5e622f6f6f1317141f7b
Reviewed-on: https://go-review.googlesource.com/c/net/+/203518
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-10-27 09:30:00 +00:00
Tobias Klauser
ec77196f60 ipv6: re-enable tests on Dragonfly
Now that golang.org/x/net was re-vendored into std, these tests should
pass again.

Updates golang/go#34368

Change-Id: I6f253896836fb18d46875a9420de58ca05a49646
Reviewed-on: https://go-review.googlesource.com/c/net/+/202457
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-21 14:45:47 +00:00
Tobias Klauser
24d2ffbea1 all: fix tests on dragonfly after ABI changes
Detect the ABI version based on kern.osreldate.

Only use 32-bit cmsg alignment for versions before the September 2019
ABI changes:
http://lists.dragonflybsd.org/pipermail/users/2019-September/358280.html

Use RTM_VERSION 7 on Dragonfly master (5.8 release).

Determine sizeof struct ifa_msghdr at runtime based on the ABI version.

Temporarily skip some test relying on the net package which will only be
fixed once this CL is re-vendored into std.

Updates golang/go#34368

Change-Id: I732fab21d569b303f45dfb6a0bbbb11469511a07
Reviewed-on: https://go-review.googlesource.com/c/net/+/202317
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-10-21 12:47:07 +00:00
Moritz Fain
da9a3fd4c5 http2: make Transport.NewClientConn respect Transport.DisableKeepAlives
While in http/1.1 the `http.Transport.DisableKeepAlives` directive disallows re-usage of the connection, in http2 it's currently implemented as "close the connection as soon as possible" (when the connection is idle).

Fixes golang/go#33260

Change-Id: I5c167029062168f53a2cd15b5fbd19c1589cf175
GitHub-Last-Rev: e35ab6278d
GitHub-Pull-Request: golang/net#48
Reviewed-on: https://go-review.googlesource.com/c/net/+/187958
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-14 21:28:45 +00:00
Michael Fraenkel
2ba7206551 http2: track unread bytes when the pipe is broken
Once the pipe is broken, any remaining data needs to be reported as well
as any data that is written but dropped.

The client side flow control can eventually run out of available bytes
to be sent since no WINDOW_UPDATE is sent to reflect the data that is
never read in the pipe.

Updates golang/go#28634

Change-Id: I83f3c9d3614cd92517af2687489d2ccbf3a65456
Reviewed-on: https://go-review.googlesource.com/c/net/+/187377
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-14 20:34:26 +00:00
Olivier Poitrey
491137f692 http2: split cookie pair into separate hpack header fields
As per 8.1.2.5, To allow for better compression efficiency, the Cookie header
field MAY be split into separate header fields, each with one or more
cookie-pairs.

Fixes golang/go#29386

Change-Id: Ia73aea00b76350c822544f180b5da19d50e51f68
Reviewed-on: https://go-review.googlesource.com/c/net/+/155657
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-11 23:46:55 +00:00
Emmanuel T Odeke
d66e71096f http2: do not sniff body if Content-Encoding is set
Updates golang/go#31753

Change-Id: I2481ffcff6626c08ef32a02cffb3f108737fa87e
Reviewed-on: https://go-review.googlesource.com/c/net/+/199841
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-10-09 17:08:51 +00:00
Brad Fitzpatrick
72f9393749 http2/h2demo: update README
Fixes golang/go#34729

Change-Id: I8a5dde21d9e0f0a8b95500cc3bbbbca693aa1637
Reviewed-on: https://go-review.googlesource.com/c/net/+/199579
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-10-07 18:20:48 +00:00
Brad Fitzpatrick
d98b1b4438 http2: fix memory leak in random write scheduler
In certain shutdown cases (from the client and/or server), the http2
Server can Push stream-specific frames on closed streams. This caused
memory leaks in the random write scheduler.

As a conservative fix for backporting, just clear the map element
whenever its queue value is empty. The map entry is re-created as
needed anyway. This isn't perfectly ideal (it adds a map+delete and
free queue put+get) in the case where a stream is open & actively
writing, but it's an easy fix for now. A future CL can optimize all
this code. It looks like there are some other good optimization
opportunities in related code anyway. But I'd rather that happen on
master and not be done in a backported change.

Fixes golang/go#33812

Change-Id: I21508ba2ebc361e8b8532d0d1cebf882e82c473c
Reviewed-on: https://go-review.googlesource.com/c/net/+/198462
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-10-03 17:11:28 +00:00
Dario
2ec189313e html: fix tokenizer error
Trailing '<' entities in the text token make the tokenizer fail
for escapable raw text elements like title and textarea

Fixes golang/go#34281

Change-Id: I6fe8f2229b5fd639cf5a02ab1db31f18ea034c8b
GitHub-Last-Rev: 4a9da03177
GitHub-Pull-Request: golang/net#53
Reviewed-on: https://go-review.googlesource.com/c/net/+/196620
Run-TryBot: Kunpei Sakai <kunpei@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-10-02 03:54:40 +00:00
Nigel Tao
2e5a9a9514 html: add Tokenizer.Raw comment re byte offsets
Change-Id: I2a08f28fcc58869b0e8a3b21b9a9c97da5063014
Reviewed-on: https://go-review.googlesource.com/c/net/+/198357
Reviewed-by: David Symonds <dsymonds@golang.org>
2019-10-02 03:42:24 +00:00
Antonio Huete Jimenez
c5a3c61f89 all: adjust defs for Dragonfly BSD
- DragonFly BSD removed RTM_OLDADD and RTM_OLDDEL
  constants on Aug 4th, 2017 and are now gone in both master
  branch and RELEASE 5.6. It also removed IPV6_IPSEC_POLICY
  constant since IPSEC was removed from base and kernel.

Change-Id: I99fbdfcb95fb276374f7b2dbd5fa30fe3f30f709
GitHub-Last-Rev: 1f27a0e26e
GitHub-Pull-Request: golang/net#54
Reviewed-on: https://go-review.googlesource.com/c/net/+/197599
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Benny Siegert <bsiegert@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-30 13:41:27 +00:00
Dmitri Shuralyov
c00fd9afed http2/h2demo: deploy with Go 1.13
Update the base image to Go 1.13. It is the latest Go release and
it has TLS 1.3 on by default.

Remove the explicit setting of GOPROXY to https://proxy.golang.org,
since that value is already the default in Go 1.13.

Change-Id: I0d9b684a7f53d27d21b0f92b300ec64d4d47e1fe
Reviewed-on: https://go-review.googlesource.com/c/net/+/196139
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-09-26 02:58:31 +00:00
Gregory Man
aa69164e44 xsrftoken: escape colons
The current clean() replaces : with _ (colons are internally used as
separators).
This produce can produce same output for different inputs, for example
the user _foo_ can obtain valid tokens for user :foo:.

This CL replace colons with double colons instead of replacing them
with underscores.

Fixes golang/go#34308

Change-Id: I3e4148a0836e62fda1a5f0ba32b375121368afd3
Reviewed-on: https://go-review.googlesource.com/c/net/+/196457
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-23 16:28:16 +00:00
Anmol Sethi
1a5e07d1ff websocket: Add nhooyr.io/websocket to the deprecation message
My library is a well maintained alternative as well and is easier to transition to thanks to the [NetConn](https://godoc.org/nhooyr.io/websocket#NetConn) wrapper.

Updates https://github.com/golang/go/issues/18152

Change-Id: Iff9addebcee4f39dbd9f015d0fbe7613e4ee45dd
GitHub-Last-Rev: 0ae267b16a
GitHub-Pull-Request: golang/net#51
Reviewed-on: https://go-review.googlesource.com/c/net/+/193217
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-09-21 01:59:27 +00:00
Dmitri Shuralyov
a8b05e9114 http2/h2demo: remove h2demo build constraint
The build constraint is no longer useful. It doesn't prevent this
package contributing module requirements to x/net, that was already
resolved by carving h2demo into its own module in golang/go#30685.
Few people do go get -u golang.org/x/net/... in GOPATH mode by now,
so there's no need to optimize for avoiding polluting GOPATH/bin.

Removing the build constraint allows the package to be visible and
tested by trybots and builders. It's also simpler.

Fixes golang/go#34361

Change-Id: I84b5d70aab210ca8e4f5494160ae4d9049ef08ad
Reviewed-on: https://go-review.googlesource.com/c/net/+/196036
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-09-18 13:04:20 +00:00
Tobias Klauser
c8589233b7 internal/socket: remove unused sizeofMmsghdr const
Change-Id: I6f66e2fd93916438ad959de469ee081b7085fe1a
Reviewed-on: https://go-review.googlesource.com/c/net/+/195597
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-09-16 14:08:28 +00:00
Tianji Wu
24e19bdeb0 http2: end stream eagerly after sending the request body
Check EOF eagerly on the request body when its content-length
is specified and it is expected to end. Thus, the data frame
containing the last chunk of data of the body will be marked with
END_STREAM eagerly.

In case the request body is larger than the specified content-length,
the request will be aborted and returned with an error.

Fixes golang/go#32254

Change-Id: Id24c043c7cc3a41421dfd099a139f1b1e08056b9
Reviewed-on: https://go-review.googlesource.com/c/net/+/181157
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-12 16:07:10 +00:00
Ainar Garipov
a7b16738d8 all: fix typos
Change-Id: I86005e1f17747e4ffe4fc544546e980b987bad36
Reviewed-on: https://go-review.googlesource.com/c/net/+/193799
Reviewed-by: Toshihiro Shiino <shiino.toshihiro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-09-09 00:30:24 +00:00
Aofei Sheng
ba9fcec4b2 http2: correct ServeConnOpts.context's nil receiver check
Fixes golang/go#33839

Change-Id: Ic1a9e42afc8efda7ec2d39e705efe41474237d82
Reviewed-on: https://go-review.googlesource.com/c/net/+/191857
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-08-27 16:04:01 +00:00
Filippo Valsorda
74dc4d7220 http2: limit number of control frames in server send queue
An attacker could cause servers to queue an unlimited number of PING
ACKs or RST_STREAM frames by soliciting them and not reading them, until
the program runs out of memory.

Limit control frames in the queue to a few thousands (matching the limit
imposed by other vendors) by counting as they enter and exit the scheduler,
so the protection will work with any WriteScheduler.

Once the limit is exceeded, close the connection, as we have no way to
communicate with the peer.

This addresses CVE-2019-9512 and CVE-2019-9514.

Fixes golang/go#33606

Change-Id: I842968fc6ed3eac654b497ade8cea86f7267886b
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/525552
Reviewed-by: Brad Fitzpatrick <bradfitz@google.com>
2019-08-13 10:13:03 -04:00
Pascal Dierich
ca1201d0de http2: use updated URI in doc
Fixes golang/go#33246

Change-Id: Iefb39f086eebfa2707725f7464339fca6cff9afd
Reviewed-on: https://go-review.googlesource.com/c/net/+/187277
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2019-07-24 01:30:45 +00:00
Jacob Blain Christen
da137c7871 proxy: fix TestDial failures on wasm/js
Modified `TestDial` to emulate `internal/socks/dial_test.go` and leverage `nettest#NetLocalListener()` while also honoring the returned `net.Listener` address. It seems that the wasm/js runtime doesn't like dialing addresses with no host.

Fixes golang/go#32842

Change-Id: I1915f2ebac773f24a5b37ab7c09a52137abe758d
GitHub-Last-Rev: 8f2967fa7d
GitHub-Pull-Request: golang/net#45
Reviewed-on: https://go-review.googlesource.com/c/net/+/184178
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-06-28 18:53:45 +00:00
Tobias Klauser
3b0461eec8 internal/socket, ipv4, ipv6: add support for GOOS=illumos
Treat it like GOOS=solaris for now.

Change-Id: I2b99427e80058f6c7308fe3752de21610457a3ba
Reviewed-on: https://go-review.googlesource.com/c/net/+/183277
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-06-20 20:02:07 +00:00
Volker Dobler
b5b0513f8c publicsuffix: update table to latest list from publicsuffix.org
Update the list to revision 6f03f42a65d006c8ae657f125f14fb8f9d3337f4
(2019-05-31T16:38:49Z).

Change-Id: I4108c6233ff9ee2250900ece0eb13e8ce3da2b00
Reviewed-on: https://go-review.googlesource.com/c/net/+/182737
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-06-19 01:48:44 +00:00
Tobias Klauser
d28f0bde59 all: follow convention for generated code comment
Follow the convertion (https://golang.org/s/generatedcode) for generated
code.

Change-Id: I3101fb91db42644ead179ffaeffe0211359ac886
Reviewed-on: https://go-review.googlesource.com/c/net/+/182137
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-06-13 19:41:53 +00:00
Tobias Klauser
3f473d35a3 internal/socket: add support for freebsd/arm64
Updates golang/go#24715

Change-Id: I4e87b6101069eb9ff745fdfac6d4f6b4884a995c
Reviewed-on: https://go-review.googlesource.com/c/net/+/181618
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-06-11 14:12:13 +00:00
Tobias Klauser
dbab0cf9d9 internal/socket: add support for openbsd/arm64
Updates golang/go#31656

Change-Id: I238655c111e8422c60d20d853aeb965be16c1c7e
Reviewed-on: https://go-review.googlesource.com/c/net/+/181617
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-06-11 14:11:12 +00:00
Brad Fitzpatrick
461777fb6f http2: support getting the Server connection's base context from net/http
This is the x/net/http2 half of the fix. The net/http half is in CL 181260.

Updates golang/go#32476
Updates golang/go#30694

Change-Id: Ic25c678dad99acc4ae8d679384d9e9a38dc1291c
Reviewed-on: https://go-review.googlesource.com/c/net/+/181259
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-06-07 18:15:51 +00:00
Brad Fitzpatrick
26fcbda1b1 go.mod: add go language version
The go tool kept inserting "go 1.13" so I'm adding an explicit line so
it stops modifying my local files when I'm working on other changes.

Change-Id: I82b8de13a75271f04dce78f9e939aefe1d24fc6d
Reviewed-on: https://go-review.googlesource.com/c/net/+/181257
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-06-07 17:52:57 +00:00
Brad Fitzpatrick
d5cec38845 http2: disable a flaky test on Windows for now, add more logging
Updates golang/go#31260

Change-Id: Icf26461dc48f5f16a91a93df6aa78fec1338f51f
Reviewed-on: https://go-review.googlesource.com/c/net/+/181198
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-06-07 17:21:44 +00:00
Arthur Fabre
27ecd3f315 bpf: fix VM out of bounds LoadMemShift check
The bpf VM did not correctly check the bounds of LoadMemShift
instructions, as it used a size of 0 instead of the correct 1.

A LoadMemShift instruction 1 past the end of the input resulted in a
runtime panic:

    panic(0x5c1d40, 0x7cec00)
            /usr/local/go/src/runtime/panic.go:522 +0x1b5
    golang.org/x/net/bpf.loadMemShift(...)
            /home/afabre/go/pkg/mod/golang.org/x/net@v0.0.0-20190603091049-60506f45cf65/bpf/vm_instructions.go:137
    golang.org/x/net/bpf.(*VM).Run(0xc00000ec40, 0xc0000173c8, 0x2, 0x8, 0x2, 0xc0000173c8, 0x0)
            /home/afabre/go/pkg/mod/golang.org/x/net@v0.0.0-20190603091049-60506f45cf65/bpf/vm.go:131 +0xb0a

Fix this, and rework the out of bounds tests for load instructions to:

* Use an offset one past the end of the input, to catch this

* Use a filter that returns 1, to catch cases were the out of bounds
load does not cause a panic, but does not cause the VM to return 0.

Change-Id: I1e68886915207a34f59765805f907f36dc031f70
Reviewed-on: https://go-review.googlesource.com/c/net/+/180979
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-06-07 17:17:31 +00:00
Mykhailo Lesyk
1492cefac7 webdav: remove redundant trailing slash for root directory
Fixes golang/go#31983

Change-Id: I9925f392ea98cd6618551e936e1dbd5a2a9324c9
GitHub-Last-Rev: dba5c6876c
GitHub-Pull-Request: golang/net#42
Reviewed-on: https://go-review.googlesource.com/c/net/+/176737
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-06-06 17:38:56 +00:00
Tobias Klauser
60506f45cf internal/socket: add support for netbsd/arm64
Updates golang/go#30824

Change-Id: I872b725d6640e29570652171b6c45634fc21a461
Reviewed-on: https://go-review.googlesource.com/c/net/+/179939
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
2019-06-03 09:10:49 +00:00
Tobias Klauser
f3200d17e0 internal/socket: remove leftover AF_* and SOCK_RAW constants on aix
Follow-up for CL 53310 which changed internal/socket to use these
constants from golang.org/x/sys/unix

Change-Id: I40fde84c875995fbeef2d21f8e05f5ba27b11098
Reviewed-on: https://go-review.googlesource.com/c/net/+/178557
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-05-22 15:58:17 +00:00
Tobias Klauser
fa69b94a3b internal/socket: use AF_* and SOCK_RAW constants from x/sys
Use the AF_UNSPEC, AF_INET, AF_INET6 and SOCK_RAW constants from
golang.org/x/sys instead of locally deriving them from the C headers (or
hard coding them in the case of Windows).

Change-Id: I37fe61d0435b6c615cd767eef38380db4b4af7b1
Reviewed-on: https://go-review.googlesource.com/c/net/+/53310
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-22 13:53:03 +00:00
CarlosEDP
018c4d40a1 ipv4, ipv6, internal/socket: add riscv64 support
Updates golang/go#27532

Change-Id: I64285280680e5d1d3903c352454f2c67cc653c88
GitHub-Last-Rev: 3747f61487
GitHub-Pull-Request: golang/net#43
Reviewed-on: https://go-review.googlesource.com/c/net/+/177997
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-05-20 21:01:07 +00:00
Michael Fraenkel
3ec1911272 http2: track reused connections
nextStreamID was used as a means to determine if the connection was
being reused. Multiple requests can see a new connection because the
nextStreamID is updated after a ClientTrace reports it is being reused.

Updates golang/go#31982

Change-Id: Iaa4b62b217f015423cddb99fd86de75a352f8320
Reviewed-on: https://go-review.googlesource.com/c/net/+/176720
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-14 14:07:10 +00:00
Brad Fitzpatrick
a4d6f7fead http2/h2demo: stop using gitlock, use Go modules
Updates golang/go#26872

Change-Id: If2a96708d1fcf43b7ce20a48fa5ae3492f970187
Reviewed-on: https://go-review.googlesource.com/c/net/+/176318
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-05-09 22:28:00 +00:00
Brad Fitzpatrick
f4e77d36d6 proxy: add ProxyFromEnvironmentUsing
Updates golang/go#31813

Change-Id: Ic05fcdb5881c9e01967697542228224611b7a73f
Reviewed-on: https://go-review.googlesource.com/c/net/+/175100
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jacob Blain Christen <dweomer5@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-03 19:29:46 +00:00
Jacob Blain Christen
7f726cade0 proxy: add Dial (with context)
The existing API does not allow client code to take advantage of Dialer implementations that implement DialContext receivers. This a familiar API, see net.Dialer.

Fixes golang/go#27874
Fixes golang/go#19354
Fixes golang/go#17759
Fixes golang/go#13455

Change-Id: I0f247783d2037da28c9917db99adda51db1647bd
GitHub-Last-Rev: b0a372707f
GitHub-Pull-Request: golang/net#38
Reviewed-on: https://go-review.googlesource.com/c/net/+/168921
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-05-02 18:39:28 +00:00
Kunpei Sakai
9ce7a6920f html: implement ParseWithOptions and ParseFragmentWithOptions
This commit newly introduces a type for configuring a parser
called ParseOption, and implements two functions depending on it.
Along with that, this introduces ParseOptionEnableScripting to
enable setting of the scripting flag.

Fixes golang/go#16318

Change-Id: Ie7fd7d8ce286e22e7f57182fc2ce353bce578db6
Reviewed-on: https://go-review.googlesource.com/c/net/+/174157
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-05-01 00:44:15 +00:00
Marcel van Lohuizen
4829fb13d2 idna: update to Unicode 11
Also adopt Unicode selection based on the Unicode
version used by the go binary, as is done in x/text.

Change-Id: I334897e15b2e6fcc6ca175e7eaaa6262ae838f80
Reviewed-on: https://go-review.googlesource.com/c/net/+/172738
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-24 11:20:56 +00:00
Volker Dobler
afe8014c97 publicsuffix: domain labels may not be empty
EffectiveTLDPlusOne hands it argument to PublicSuffix which produces
output for all its arguments, even for non-domain names like ".com.au"
and does not report an error.

This CL captures this type of malformed input to EffectiveTLDPlusOne
and returns an error if any label in the domain name is empty (or the
domain is fully qualified).
This is still not a proper input validation e.g. IP addresses can
still be fed into EffectiveTLDPlusOne without error.

Fixes golang/go#30652

Change-Id: I12b0945bc3c7e5d192a71c5488361a60a48454b1
Reviewed-on: https://go-review.googlesource.com/c/net/+/172537
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-24 02:48:45 +00:00
Tom Anthony
ce75fb3bc6 html: Add missing condition to 'in cell' insertion mode, required by spec
In section 12.2.6.4.15 of the spec, there is a condition that the current node is a td or th element, which is not implemented. This can lead to a panic when the open elements stack is popped whilst empty, as outlined in golang/go#30600. This commit implements that check.

Fixes golang/go#30600

Change-Id: I4837815e2edce21b58a985a100d93d146bf71e24
GitHub-Last-Rev: 79084c5a84
GitHub-Pull-Request: golang/net#41
Reviewed-on: https://go-review.googlesource.com/c/net/+/172377
Reviewed-by: Kunpei Sakai <namusyaka@gmail.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-24 02:45:59 +00:00
Kunpei Sakai
574d568418 html: add "in head noscript" im support
In the spec 12.2.6.4.5, the "in head noscript" insertion mode is defined.
However, this package and its parser doesn't have the insertion mode,
because the scripting=false case is not considered currently.

This commit adds a test and a support for the "in head noscript"
insertion mode. This change has no effect on the actual behavior.

Updates golang/go#16318

Change-Id: I9314c3342bea27fa2acf2fa7d980a127ee0fbf91
Reviewed-on: https://go-review.googlesource.com/c/net/+/172557
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-04-24 02:42:50 +00:00