DisableHTMLEscaping is now SetEscapeHTML, allowing the escaping
to be toggled, not just disabled. This API is new for Go 1.7,
so there are no compatibility concerns (quite the opposite,
the point is to fix the API before we commit to it in Go 1.7).
Change-Id: I96b9f8f169a9c44995b8a157a626eb62d0b6dea7
Reviewed-on: https://go-review.googlesource.com/23293
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Andre wrote https://golang.org/cl/13454043 (never submitted),
which served as the basis for Ross Light's https://golang.org/cl/19235.
Individual CLA verified by hand.
Change-Id: Ic09e8efd84b7ded3ae472c204133e40cb85d97f7
Reviewed-on: https://go-review.googlesource.com/23377
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
In earlier versions of Go the result was simply "?".
A change in this cycle made the result echo back the hex bytes
of the address, which is certainly useful, but now the result is
not clearly indicating an error. Put the "?" back, at the beginning
of the hex string, to make the invalidity of the string clearer.
Change-Id: I3e0f0b6a005601cd98d982a62288551959185b40
Reviewed-on: https://go-review.googlesource.com/23376
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The use of a prefix check was too liberal.
Noted in review after submit.
Change-Id: I4fe1df660997efd225609e818040b8392fab79f0
Reviewed-on: https://go-review.googlesource.com/23375
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
CL 19725 changed the encoding of []typedByte to look for
typedByte.MarshalJSON and typedByte.MarshalText.
Previously it was handled like []byte, producing a base64 encoding of the underlying byte data.
CL 19725 forgot to look for (*typedByte).MarshalJSON and (*typedByte).MarshalText,
as the marshaling of other slices would. Add test and fix for those.
This CL also adds tests that the decoder can handle both the old and new encodings.
(This was true even in Go 1.6, which is the only reason we can consider this
not an incompatible change.)
For #13783.
Change-Id: I7cab8b6c0154a7f2d09335b7fa23173bcf856c37
Reviewed-on: https://go-review.googlesource.com/23294
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Now that CSE uses dom tree to order partitions, we need the
dom tree computed before benchmarking CSE.
Fixes#15801
Change-Id: Ifa4702c7b75250f34de185e69a880b3f3cc46a12
Reviewed-on: https://go-review.googlesource.com/23361
Reviewed-by: David Chase <drchase@google.com>
In n:1 variable declarations (multiple lhs variables with single
multi-valued initialization expression) where also a variable
type is provided, make sure that that type is assigned to all
variables on the lhs before the init expression assignment is
checked. Otherwise, (some) variables are assumed to take the type
of the corresponding value of the multi-valued init expression.
Fixes#15755.
Change-Id: I969cb5a95c85e28dbb38abd7fa7df16ff5554c03
Reviewed-on: https://go-review.googlesource.com/23313
Reviewed-by: Alan Donovan <adonovan@google.com>
The source xml data has changed, so running genzabbrs.go
regenerates a new time zone file in zoneinfo_abbrs_windows.go
which adds some zones and adjusts others.
Now set export ZONEINFO=$GOROOT/lib/time/zoneinfo.zip to use zoneinfo.zip in go tip.
Change-Id: I19f72359cc808094e5dcb420e480a00c6b2205d7
Reviewed-on: https://go-review.googlesource.com/23321
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Add Abe Haskins (individual CLA)
Add Ahmy Yulrizka (individual CLA)
Add Akihiro Suda (individual CLA)
Add Alex Vaghin (corporate CLA for Google Inc.)
Add Arlo Breault (individual CLA)
Add Audrey Lim (individual CLA)
Add Benjamin Wester (corporate CLA for Square, Inc.)
Add Bryan Chan (corporate CLA for IBM)
Add Christy Perez (corporate CLA for IBM)
Add Colin Edwards (individual CLA)
Add David Brophy (individual CLA)
Add David Sansome (individual CLA)
Add Diwaker Gupta (individual CLA)
Add Doug Anderson (corporate CLA for Google Inc.)
Add Dustin Carlino (corporate CLA for Google Inc.)
Add Ernest Chiang (individual CLA)
Add Ethan Burns (corporate CLA for Google Inc.)
Add Gary Elliott (corporate CLA for Google Inc.)
Add Hallgrimur Gunnarsson (corporate CLA for Google Inc.)
Add Hironao OTSUBO (individual CLA)
Add Holden Huang (individual CLA)
Add Idora Shinatose (individual CLA)
Add Irieda Noboru (individual CLA)
Add Jeff Craig (corporate CLA for Google Inc.)
Add Joe Henke (individual CLA)
Add John Schnake (individual CLA)
Add Jonathan Amsterdam (corporate CLA for Google Inc.)
Add Kenji Kaneda (individual CLA)
Add Kenneth Shaw (individual CLA)
Add Mark Severson (individual CLA)
Add Martin Garton (individual CLA)
Add Mathias Leppich (individual CLA)
Add Maxwell Krohn (individual CLA)
Add Niall Sheridan (individual CLA)
Add Nick Patavalis (individual CLA)
Add Nick Petroni (individual CLA)
Add Omar Jarjur (corporate CLA for Google Inc.)
Add Özgür Kesim (individual CLA)
Add Peter Gonda (corporate CLA for Google Inc.)
Add Pierre Durand (individual CLA)
Add Quentin Smith (corporate CLA for Google Inc.)
Add Ricardo Padilha (individual CLA)
Add Riku Voipio (corporate CLA for Linaro Limited)
Add Roland Shoemaker (individual CLA)
Add Sam Hug (individual CLA)
Add Sam Whited (individual CLA)
Add Sami Commerot (corporate CLA for Google Inc.)
Add Scott Mansfield (corporate CLA for Netflix, Inc.)
Add Sean Harger (corporate CLA for Google Inc.)
Add Simon Jefford (individual CLA)
Add Sridhar Venkatakrishnan (individual CLA)
Add Tim Swast (corporate CLA for Google Inc.)
Add Timothy Studd (individual CLA)
Add Tipp Moseley (corporate CLA for Google Inc.)
Add Toby Burress (corporate CLA for Google Inc.)
Add Tzu-Jung Lee (corporate CLA for Currant)
Add Vadim Grek (individual CLA)
Add Xudong Zhang (individual CLA)
Updates #12042
Change-Id: I4119a8829119a2b8a9abbea9f52ceebb04878764
Reviewed-on: https://go-review.googlesource.com/23306
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Updates x/net/http2 to git rev 0c607074 for https://golang.org/cl/23311,
"http2: prevent Server from sending status 100 header after anything else"
New test is in the x/net/http2 package (not bundled to std).
Fixes#14030
Change-Id: Ifc6afa4a5fe35977135428f6d0e9f7c164767720
Reviewed-on: https://go-review.googlesource.com/23312
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Also renames the test function to TestDNSFlood.
Updates #15659.
Change-Id: Ia562004c43bcc19c2fee9440321c27b591f85da5
Reviewed-on: https://go-review.googlesource.com/23077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Add Aiden Scandella (individual CLA)
Add Alessandro Arzilli (individual CLA)
Add Augusto Roman (individual CLA)
Add Brady Catherman (individual CLA)
Add Brady Sullivan (individual CLA)
Add Caio Marcelo de Oliveira Filho (corporate CLA for Intel Corporation)
Add Catalin Nicutar (corporate CLA for Google Inc.)
Add Cherry Zhang (corporate CLA for Google Inc.)
Add Chris Zou (corporate CLA for IBM)
Add Christopher Nelson (individual CLA)
Add Conrad Irwin (individual CLA)
Add Cuihtlauac ALVARADO (corporate CLA for Orange)
Add Daniel Speichert (individual CLA)
Add Datong Sun (individual CLA)
Add Denys Honsiorovskyi (individual CLA)
Add Derek Shockey (individual CLA)
Add Dmitriy Dudkin (individual CLA)
Add Dustin Herbis (individual CLA)
Add Frits van Bommel (individual CLA)
Add Harshavardhana (individual CLA)
Add Hitoshi Mitake (individual CLA)
Add James Bardin (individual CLA)
Add James Chacon (corporate CLA for Google Inc.)
Add Jamil Djadala (individual CLA)
Add Jess Frazelle (individual CLA)
Add Joe Sylve (individual CLA)
Add Johan Sageryd (individual CLA)
Add John Jeffery (individual CLA)
Add Julia Hansbrough (corporate CLA for Google Inc.)
Add Jure Ham (corporate CLA for Zemanta d.o.o.)
Add Kamal Aboul-Hosn (corporate CLA for Google Inc.)
Add Kevin Burke (individual CLA)
Add Kevin Kirsche (individual CLA)
Add Kevin Vu (individual CLA)
Add Lee Hinman (individual CLA)
Add Luan Santos (individual CLA)
Add Marc-Antoine Ruel (corporate CLA for Google Inc.)
Add Matt Robenolt (individual CLA)
Add Michael McConville (individual CLA)
Add Michael Munday (corporate CLA for IBM)
Add Michael Pratt (corporate CLA for Google Inc.)
Add Michel Lespinasse (corporate CLA for Google Inc.)
Add Mike Danese (corporate CLA for Google Inc.)
Add Mikhail Gusarov (individual CLA)
Add Monty Taylor (individual CLA)
Add Morten Siebuhr (individual CLA)
Add Muhammed Uluyol (individual CLA)
Add Niels Widger (individual CLA)
Add Niko Dziemba (individual CLA)
Add Olivier Poitrey (individual CLA)
Add Paul Wankadia (corporate CLA for Google Inc.)
Add Philip Hofer (individual CLA)
Add Prashant Varanasi (individual CLA)
Add Rhys Hiltner (corporate CLA for Amazon.com, Inc)
Add Richard Miller (individual CLA)
Add Scott Bell (individual CLA)
Add Shahar Kohanim (individual CLA)
Add Shinji Tanaka (individual CLA)
Add Suharsh Sivakumar (corporate CLA for Google Inc.)
Add Tal Shprecher (individual CLA)
Add Tilman Dilo (individual CLA)
Add Tim Ebringer (individual CLA)
Add Tom Bergan (corporate CLA for Google Inc.)
Add Vishvananda Ishaya (individual CLA)
Add Wedson Almeida Filho (corporate CLA for Google Inc.)
Add Zhongwei Yao (corporate CLA for ARM Ltd.)
Updates #12042
Change-Id: Ia118adc2eb38e5ffc8448de2d9dd3ca792ee7227
Reviewed-on: https://go-review.googlesource.com/23303
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Ignore respective bit in export data, but leave the info to
minimize format changes for 1.7. Scheduled to remove by 1.8.
For #15772.
Change-Id: Ifb3beea655367308a4e2d5dc8cb625915f904287
Reviewed-on: https://go-review.googlesource.com/23285
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Updates x/net/http2 to git rev 202ff482 for https://golang.org/cl/23235 (Expect:
100-continue support for HTTP/2)
Fixes a flaky test too, and changes the automatic HTTP/2 behavior to
no longer special-case the DefaultTransport, because
ExpectContinueTimeout is no longer unsupported by the HTTP/2
transport.
Fixes#13851Fixes#15744
Change-Id: I3522aace14179a1ca070fd7063368a831167a0f7
Reviewed-on: https://go-review.googlesource.com/23254
Reviewed-by: Andrew Gerrand <adg@golang.org>
This patch adds Unshare flags to SysProcAttr for Linux systems.
Fixes#1954
Change-Id: Id819c3f92b1474e5a06dd8d55f89d74a43eb770c
Reviewed-on: https://go-review.googlesource.com/23233
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Non-syntax errors are always counted to determine if to exit
early, but then deduplication eliminates them. This can lead
to situations which report "too many errors" and only one
error is shown.
De-duplicate non-syntax errors early, at least the ones that
appear consecutively, and only count the ones actually being
shown. This doesn't work perfectly as they may not appear in
sequence, but it's cheap and good enough.
Fixes#14136.
Change-Id: I7b11ebb2e1e082f0d604b88e544fe5ba967af1d7
Reviewed-on: https://go-review.googlesource.com/23259
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
In Go versions 1 up to and including Go 1.6,
ResponseRecorder.HeaderMap was both the map that handlers got access
to, and was the map tests checked their results against. That did not
mimic the behavior of the real HTTP server (Issue #8857), so HeaderMap
was changed to be a snapshot at the first write in
https://golang.org/cl/20047. But that broke cases where the Handler
never did a write (#15560), so revert the behavior.
Instead, introduce the ResponseWriter.Result method, returning an
*http.Response. It subsumes ResponseWriter.Trailers which was added
for Go 1.7 in CL 20047. Result().Header now contains the correct
answer, and HeaderMap is unchanged in behavior from previous Go
releases, so we don't break people's tests. People wanting the correct
behavior can use ResponseWriter.Result.
Fixes#15560
Updates #8857
Change-Id: I7ea9b56a6b843103784553d67f67847b5315b3d2
Reviewed-on: https://go-review.googlesource.com/23257
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Currently it's possible for user code to exploit the high scheduler
priority of the GC worker in conjunction with the runnext optimization
to elevate a user goroutine to high priority so it will always run
even if there are other runnable goroutines.
For example, if a goroutine is in a tight allocation loop, the
following can happen:
1. Goroutine 1 allocates, triggering a GC.
2. G 1 attempts an assist, but fails and blocks.
3. The scheduler runs the GC worker, since it is high priority.
Note that this also starts a new scheduler quantum.
4. The GC worker does enough work to satisfy the assist.
5. The GC worker readies G 1, putting it in runnext.
6. GC finishes and the scheduler runs G 1 from runnext, giving it
the rest of the GC worker's quantum.
7. Go to 1.
Even if there are other goroutines on the run queue, they never get a
chance to run in the above sequence. This requires a confluence of
circumstances that make it unlikely, though not impossible, that it
would happen in "real" code. In the test added by this commit, we
force this confluence by setting GOMAXPROCS to 1 and GOGC to 1 so it's
easy for the test to repeated trigger GC and wake from a blocked
assist.
We fix this by making GC always put user goroutines at the end of the
run queue, instead of in runnext. This makes it so user code can't
piggy-back on the GC's high priority to make a user goroutine act like
it has high priority. The only other situation where GC wakes user
goroutines is waking all blocked assists at the end, but this uses the
global run queue and hence doesn't have this problem.
Fixes#15706.
Change-Id: I1589dee4b7b7d0c9c8575ed3472226084dfce8bc
Reviewed-on: https://go-review.googlesource.com/23172
Reviewed-by: Rick Hudson <rlh@golang.org>
Currently ready always puts the readied goroutine in runnext. We're
going to have to change this for some uses, so add a flag for whether
or not to use runnext.
For now we always pass true so this is a no-op change.
For #15706.
Change-Id: Iaa66d8355ccfe4bbe347570cc1b1878c70fa25df
Reviewed-on: https://go-review.googlesource.com/23171
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
When the generated stub functions write back the results to the stack,
they can in some cases be writing to the same memory on the g0 stack.
There is no race here (assuming there is no race in the Go code), but
the thread sanitizer does not know that. Turn off the thread sanitizer
for the stub functions to prevent false positive warnings.
Current clang suggests the no_sanitize("thread") attribute, but that
does not work with clang 3.6 or GCC. clang 3.6, GCC, and current clang
all support the no_sanitize_thread attribute, so use that
unconditionally.
The test case and first version of the patch are from Dmitriy Vyukov.
Change-Id: I80ce92824c6c8cf88ea0fe44f21cf50cf62474c9
Reviewed-on: https://go-review.googlesource.com/23252
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
OpenBSD 6.0 (due out November 2016) will support PT_TLS, which will
allow for the OpenBSD cgo pthread_create() workaround to be removed.
However, in order for Go to continue working on supported OpenBSD
releases (the current release and the previous release - 5.9 and 6.0,
once 6.0 is released), we cannot enable PT_TLS immediately. Instead,
adjust the existing code so that it works with the previous TCB
allocation and the new TIB allocation. This allows the same Go
runtime to work on 5.8, 5.9 and later 6.0.
Once OpenBSD 5.9 is no longer supported (May 2017, when 6.1 is
released), PT_TLS can be enabled and the additional cgo runtime
code removed.
Change-Id: I3eed5ec593d80eea78c6656cb12557004b2c0c9a
Reviewed-on: https://go-review.googlesource.com/23197
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gobot Gobot <gobot@golang.org>
They get rewritten to NEWs, and they must be marked as escaping
so walk doesn't try to allocate them back onto the stack.
Fixes#15733
Change-Id: I433033e737c3de51a9e83a5a273168dbc9110b74
Reviewed-on: https://go-review.googlesource.com/23223
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
The test case in #15639 somehow causes an invalid syscall frame. The
failure is obscured because the throw occurs when throwsplit == true,
which causes a "stack split at bad time" error when trying to print the
throw message.
This CL fixes the "stack split at bad time" by using systemstack. No
test because there shouldn't be any way to trigger this error anyhow.
Update #15639.
Change-Id: I4240f3fd01bdc3c112f3ffd1316b68504222d9e1
Reviewed-on: https://go-review.googlesource.com/23153
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Instead, decline the session and do a full handshake. The semantics of
cross-version resume are unclear, and all major client implementations
treat this as a fatal error. (This doesn't come up very much, mostly if
the client does the browser version fallback without sharding the
session cache.)
See BoringSSL's bdf5e72f50e25f0e45e825c156168766d8442dde and OpenSSL's
9e189b9dc10786c755919e6792e923c584c918a1.
Change-Id: I51ca95ac1691870dd0c148fd967739e2d4f58824
Reviewed-on: https://go-review.googlesource.com/21152
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Updates x/net/http2 to golang.org/cl/23220
(http2: with Go 1.7 set Request.Context in ServeHTTP handlers)
Fixes#15134
Change-Id: I73bac2601118614528f051e85dab51dc48e74f41
Reviewed-on: https://go-review.googlesource.com/23221
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Make the temporary, conservative restrictions from rev 79d9f48c in Go
1.6 permanent, and also don't do automatic TLS if the user configured
a Dial or DialTLS hook. (Go 1.7 has Transport.Dialer instead, for
tweaking dialing parameters)
Fixes#14275
Change-Id: I5550d5c1e3a293e103eb4251a3685dc204a23941
Reviewed-on: https://go-review.googlesource.com/23222
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run live vars test only on ssa builds.
We can't just drop KeepAlive ops during regalloc. We need
to replace them with copies.
Change-Id: Ib4b3b1381415db88fdc2165fc0a9541b73ad9759
Reviewed-on: https://go-review.googlesource.com/23225
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>