summaryrefslogtreecommitdiff
path: root/src/net
Commit message (Collapse)AuthorAgeFilesLines
* net/http: add comment to clarify whether Dir is '/' or '\'.Nigel Tao2014-11-141-2/+6
| | | | | | | LGTM=bradfitz R=bradfitz, alex.brainman CC=golang-codereviews https://codereview.appspot.com/168600044
* net/url: add example of using URL.Opaque with http.RequestBrad Fitzpatrick2014-11-121-0/+30
| | | | | | | | | | | Per private thread soliciting help. I realized part of this is documented in several places, but we lacked a unifying example. LGTM=rsc R=golang-codereviews CC=adg, golang-codereviews, iant, rsc https://codereview.appspot.com/171620043
* all: use golang.org/x/... import pathsAndrew Gerrand2014-11-101-1/+1
| | | | | | | LGTM=rsc, r R=r, rsc CC=golang-codereview, golang-codereviews https://codereview.appspot.com/168050043
* net/http: fix benchmark goroutine leakBrad Fitzpatrick2014-11-081-0/+1
| | | | | | | | | | | New detection because of net/http now using TestMain. Fixes Issue 9033 LGTM=iant R=golang-codereviews, iant CC=adg, golang-codereviews, rsc https://codereview.appspot.com/170210043
* net/http: add missing newline in list of leaked goroutinesIan Lance Taylor2014-10-311-1/+1
| | | | | | | LGTM=bradfitz R=bradfitz CC=golang-codereviews https://codereview.appspot.com/168860044
* net: add test for lookupIPDeadlineMikio Hara2014-10-281-0/+62
| | | | | | | | | | | | | Just to confirm the fix, by typing the follwing: go test -run=TestLookupIPDeadline -dnsflood or go test -run=TestLookupIPDeadline -dnsflood -tags netgo Update issue 8602 LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/166740043
* net: if a DNS lookup times out, forget that it is in flightIan Lance Taylor2014-10-272-28/+89
| | | | | | | | | | | | | | | | | | | | | | | | Before this CL, if the system resolver does a very slow DNS lookup for a particular host, all subsequent requests for that host will hang waiting for that lookup to complete. That is more or less expected when Dial is called with no deadline. When Dial has a deadline, though, we can accumulate a large number of goroutines waiting for that slow DNS lookup. Try to avoid this problem by restarting the DNS lookup when it is redone after a deadline is passed. This CL also avoids creating an extra goroutine purely to handle the deadline. No test because we would have to simulate a slow DNS lookup followed by a fast DNS lookup. Fixes issue 8602. LGTM=bradfitz R=bradfitz, mikioh.mikioh CC=golang-codereviews, r, rsc https://codereview.appspot.com/154610044
* net/http/pprof: run GC for /debug/pprof/heap?gc=1Russ Cox2014-10-241-0/+4
| | | | | | | | | | | | | | | | We force runtime.GC before WriteHeapProfile with -test.heapprofile. Make it possible to do the same with the HTTP interface. Some servers only run a GC every few minutes. On such servers, the heap profile will be a few minutes stale, which may be too old to be useful. Requested by private mail. LGTM=dvyukov R=dvyukov CC=golang-codereviews https://codereview.appspot.com/161990043
* net/http: don't send implicit gzip Accept-Encoding on Range requestsBrad Fitzpatrick2014-10-153-2/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The http package by default adds "Accept-Encoding: gzip" to outgoing requests, unless it's a bad idea, or the user requested otherwise. Only when the http package adds its own implicit Accept-Encoding header does the http package also transparently un-gzip the response. If the user requested part of a document (e.g. bytes 40 to 50), it appears that Github/Varnish send: range(gzip(content), 40, 50) And not: gzip(range(content, 40, 50)) The RFC 2616 set of replacements (with the purpose of clarifying ambiguities since 1999) has an RFC about Range requests (http://tools.ietf.org/html/rfc7233) but does not mention the interaction with encodings. Regardless of whether range(gzip(content)) or gzip(range(content)) is correct, this change prevents the Go package from asking for gzip in requests if we're also asking for Range, avoiding the issue. If the user cared, they can do it themselves. But Go transparently un-gzipping a fragment of gzip is never useful. Fixes Issue 8923 LGTM=adg R=adg CC=golang-codereviews https://codereview.appspot.com/155420044
* net/http: don't reuse a server connection after any Write errorsBrad Fitzpatrick2014-10-152-3/+126
| | | | | | | | | Fixes Issue 8534 LGTM=adg R=adg CC=golang-codereviews https://codereview.appspot.com/149340044
* net/rpc: fix mutex commentRob Pike2014-10-131-6/+6
| | | | | | | | | Fixes issue 8086. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/153420044
* net: link skipped TestReadFromUDP to the issueAlex Brainman2014-10-101-1/+1
| | | | | | | LGTM=minux R=bradfitz, minux CC=golang-codereviews https://codereview.appspot.com/154220043
* net: skip new TestReadFromUDP on nacl and plan9 (fixes build)Alex Brainman2014-10-101-0/+5
| | | | | | | TBR=0intro R=golang-codereviews CC=golang-codereviews https://codereview.appspot.com/157820043
* net: disable SIO_UDP_CONNRESET behavior on windows.Ron Hashimoto2014-10-102-0/+48
| | | | | | | | | | | Fixes issue 5834. LGTM=alex.brainman R=golang-codereviews, bradfitz, alex.brainman, mikioh.mikioh, in60jp, iant CC=golang-codereviews https://codereview.appspot.com/149510043 Committer: Alex Brainman <alex.brainman@gmail.com>
* net/rpc: fix buildDavid du Colombier2014-10-091-0/+1
| | | | | | | LGTM=adg R=golang-codereviews, adg CC=golang-codereviews https://codereview.appspot.com/151620043
* net/rpc: skip TestGobError on Plan 9David du Colombier2014-10-091-0/+3
| | | | | | | LGTM=bradfitz R=rsc, bradfitz CC=aram, golang-codereviews https://codereview.appspot.com/154140043
* net/rpc: listen on localhost, let kernel pick portRuss Cox2014-10-071-2/+2
| | | | | | | | | | This avoids a pop-up box on OS X and it avoids a test failure if something is using 5555. I apologize for not noticing this during the review. TBR=r CC=golang-codereviews https://codereview.appspot.com/152320044
* net/rpc: add test for issue 7689 (gob error should cause EOF)Rob Pike2014-10-071-0/+51
| | | | | | | | | Helpfully supplied by tommi.virtanen in issue 8173. LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://codereview.appspot.com/151370043
* net/http: fix authentication info leakage in Referer header (potential ↵Jens Frederich2014-10-073-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | security risk) http.Client calls URL.String() to fill in the Referer header, which may contain authentication info. This patch removes authentication info from the Referer header without introducing any API changes. A new test for net/http is also provided. This is the polished version of Alberto Garc?a Hierro's https://codereview.appspot.com/9766046/ It should handle https Referer right. Fixes issue 8417 LGTM=bradfitz R=golang-codereviews, gobot, bradfitz, mikioh.mikioh CC=golang-codereviews https://codereview.appspot.com/151430043 Committer: Brad Fitzpatrick <bradfitz@golang.org>
* net/url: document result of StringRuss Cox2014-10-061-0/+18
| | | | | | | | | Fixes issue 8742. LGTM=bradfitz R=golang-codereviews CC=adg, bradfitz, golang-codereviews, iant https://codereview.appspot.com/155910043
* net: disable TestDualStackUDPListener in short modeRuss Cox2014-10-061-0/+3
| | | | | | | | | | | | This test is flaky, just like TestDualStackTCPListener. That one was disabled. Disable this one too. Update issue 5001 LGTM=bradfitz R=rlh, bradfitz CC=golang-codereviews https://codereview.appspot.com/154950043
* net/rpc: shut down connection if gob has errorRob Pike2014-10-011-1/+24
| | | | | | | | | | | | | The nicest solution would be to buffer the message and only write it if it encodes correctly, but that adds considerable memory and CPU overhead for a very rare condition. Instead, we just shut down the connection if this happens. Fixes issue 7689. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/146670043
* net/http/httputil: ensure DumpRequestOut dumps all of BodyBrad Fitzpatrick2014-09-302-3/+39
| | | | | | | | | | | | | | | Bodies larger than 8KB (the default bufio reader size) weren't being dumped. Force a read of the body so they're teed into the response buffer. Thanks to Steven Hartland for identifying the problem. Fixes Issue 8089 LGTM=r R=golang-codereviews, r CC=adg, golang-codereviews https://codereview.appspot.com/144650044
* net/http: make Transport.CloseIdleConnections also close pending dialsBrad Fitzpatrick2014-09-293-5/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | See comment 4 of https://code.google.com/p/go/issues/detail?id=8483#c4: "So if a user creates a http.Client, issues a bunch of requests and then wants to shutdown it and all opened connections; what is she intended to do? The report suggests that just waiting for all pending requests and calling CloseIdleConnections won't do, as there can be new racing connections. Obviously she can't do what you've done in the test, as it uses the unexported function. If this happens periodically, it can lead to serious resource leaks (the transport is also preserved alive). Am I missing something?" This CL tracks the user's intention to close all idle connections (CloseIdleConnections sets it true; and making a new request sets it false). If a pending dial finishes and nobody wants it, before it's retained for a future caller, the "wantIdle" bool is checked and it's closed if the user has called CloseIdleConnections without a later call to make a new request. Fixes Issue 8483 LGTM=adg R=golang-codereviews, dvyukov, adg CC=golang-codereviews, rsc https://codereview.appspot.com/148970043
* net/http: enable Transfer-Encoding: identity without Content-Length for HTTP ↵James Tucker2014-09-292-7/+43
| | | | | | | | | | | | | | 1.1. Use case is SSE recommended configuration: http://www.w3.org/TR/eventsource/#notes Removes a TODO. LGTM=bradfitz R=golang-codereviews, bradfitz, tommi.virtanen CC=golang-codereviews https://codereview.appspot.com/100000044 Committer: Brad Fitzpatrick <bradfitz@golang.org>
* net/http: clarify Request.FormValue docsBrad Fitzpatrick2014-09-291-1/+2
| | | | | | | | | Fixes Issue 8067 LGTM=r R=r CC=golang-codereviews https://codereview.appspot.com/146480043
* net: fix misleading package comment exampleBrad Fitzpatrick2014-09-291-1/+0
| | | | | | | | | Fixes Issue 8607 LGTM=r R=r CC=golang-codereviews https://codereview.appspot.com/146470043
* net/http: update ProxyFromEnvironment docs for HTTPS_PROXY additionBrad Fitzpatrick2014-09-241-3/+10
| | | | | | | LGTM=adg R=adg CC=golang-codereviews https://codereview.appspot.com/142650043
* net/http: allow double-quotes only on cookie values, not cookieNigel Tao2014-09-252-5/+37
| | | | | | | | | | | attribute values, a la RFC 6265 section 4.1.1 "Syntax". Fixes issue 7751. LGTM=dr.volker.dobler R=dr.volker.dobler CC=bradfitz, golang-codereviews https://codereview.appspot.com/148890043
* net/http: check for CloseWrite interface, not TCPConn implementationBrad Fitzpatrick2014-09-243-2/+35
| | | | | | | | | Fixes Issue 8724 LGTM=adg R=adg CC=golang-codereviews https://codereview.appspot.com/148040043
* net/http: support https_proxy in ProxyFromEnvironmentBrad Fitzpatrick2014-09-243-6/+39
| | | | | | | | | Fixes Issue 6181 LGTM=adg R=adg CC=golang-codereviews https://codereview.appspot.com/148980043
* cmd/go: fix bytes and net the right wayRuss Cox2014-09-241-10/+0
| | | | | | | | | | | | | | | | | | | Not sure why they used empty.s and all these other packages were special cased in cmd/go instead. Add them to the list. This avoids problems with net .s files being compiled with gcc in cgo mode and gcc not supporting // comments on ARM. Not a problem with bytes, but be consistent. The last change fixed the ARM build but broke the Windows build. Maybe *this* will make everyone happy. Sigh. TBR=iant CC=golang-codereviews https://codereview.appspot.com/144530046
* net: only "build" empty.s in non-cgo modeRuss Cox2014-09-241-0/+2
| | | | | | | | | In cgo mode it gets passed to gcc, and on ARM it appears that gcc does not support // comments. TBR=iant CC=golang-codereviews https://codereview.appspot.com/142640043
* cmd/go: prohibit C sources files unless using cgoRuss Cox2014-09-241-0/+0
| | | | | | | | | | | | | | Those C files would have been compiled with 6c. It's close to impossible to use C correctly anymore, and the C compilers are going away eventually. Make them unavailable now. go1.4.txt change in CL 145890046 LGTM=iant R=iant CC=golang-codereviews, r https://codereview.appspot.com/149720043
* net/http: replace z_last_test hack with testing.MainBrad Fitzpatrick2014-09-221-9/+21
| | | | | | | LGTM=adg R=rsc, adg CC=golang-codereviews https://codereview.appspot.com/144240043
* net/http: document server recovering panicsRuss Cox2014-09-191-0/+6
| | | | | | | | | Fixes issue 8594. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://codereview.appspot.com/145760043
* net/http: ensured that proxy errors are returned by Transport.RoundTrip.John Tuley2014-09-192-1/+19
| | | | | | | | | | | Fixes issue 8755. LGTM=bradfitz R=bradfitz CC=golang-codereviews, jtuley https://codereview.appspot.com/136710044 Committer: Brad Fitzpatrick <bradfitz@golang.org>
* net: disable TestDialMultiFDLeakRuss Cox2014-09-181-0/+2
| | | | | | | | | | | It fails about 25% of the time on OS X. I don't know what it's trying to do. Created issue 8764 to correct this, but for now disable. LGTM=bradfitz, mikioh.mikioh R=bradfitz, mikioh.mikioh CC=golang-codereviews https://codereview.appspot.com/144070044
* net: separate NaCl dependent placeholders from BSD'sMikio Hara2014-09-1822-22/+182
| | | | | | | | | To clarify the dependency of NaCl platform. LGTM=adg R=golang-codereviews, adg CC=golang-codereviews https://codereview.appspot.com/143830044
* net/mail: allow us-ascii encodingRuss Cox2014-09-162-1/+22
| | | | | | | | | Fixes issue 6611. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://codereview.appspot.com/14990045
* net: make TestSelfConnect less fragileRuss Cox2014-09-161-1/+6
| | | | | | | | | | | | We believe TestSelfConnect can accidentally connect to something else listening on or dialing from that port. Fixes issue 8680. LGTM=bradfitz R=bradfitz CC=golang-codereviews, rlh https://codereview.appspot.com/136700043
* net/http: don't call FileSystem.Open with unclean index.html pathBrad Fitzpatrick2014-09-152-1/+38
| | | | | | | | | Fixes Issue 8722 LGTM=adg R=adg CC=golang-codereviews https://codereview.appspot.com/142090043
* net: fix inconsistent behavior across platforms in SetKeepAlivePeriodMikio Hara2014-09-116-57/+25
| | | | | | | | | | | | | | | The previous implementation used per-socket TCP keepalive options wrong. For example, it used another level socket option to control TCP and it didn't use TCP_KEEPINTVL option when possible. Fixes issue 8683. Fixes issue 8701. Update issue 8679 LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/136480043
* net: don't set wrong option for controlling tcp keepalive on openbsdMikio Hara2014-09-091-14/+3
| | | | | | | | | Fixes issue 8679. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/141730043
* build: move package sources from src/pkg to srcRuss Cox2014-09-08240-0/+54136
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.