Brad Fitzpatrick [Fri, 4 Nov 2011 01:12:51 +0000 (18:12 -0700)]
httputil: move dump and chunking functions out of http
This moves DumpRequest, DumpResponse, NewChunkedReader,
and NewChunkedWriter out of http, as part of the continued
http diet plan.
Also, adds DumpRequestOut (for dumping outbound requests),
since DumpRequest's ambiguity (the "wire representation" in
what direction?) was often a source of confusion and bug
reports.
David Symonds [Thu, 3 Nov 2011 21:34:37 +0000 (08:34 +1100)]
gofix: make fix order implicit by date.
This partially undoes 8fd7e6d070c8, but preserves its semantics.
More importantly, it results in the data about each fix being
decentralised, which makes it easier for new fixes to be added,
and other gofix users to slot new fixes in.
It also adds some useful metadata that could be used in the future.
Rob Pike [Thu, 3 Nov 2011 21:18:06 +0000 (14:18 -0700)]
os,text,unicode: renamings
This is Go 1 package renaming CL #4.
This one merely moves the source; the import strings will be
changed after the next weekly release.
This one moves pieces into os, text, and unicode.
Rob Pike [Thu, 3 Nov 2011 20:26:43 +0000 (13:26 -0700)]
net: renamings
This is Go 1 package renaming CL #3.
This one merely moves the source; the import strings will be
changed after the next weekly release.
This one moves pieces into net.
Rob Pike [Thu, 3 Nov 2011 19:42:57 +0000 (12:42 -0700)]
html,log,math: renamings
This is Go 1 package renaming CL #2.
This one merely moves the source; the import strings will be
changed after the next weekly release.
Note that this CL moves exp/template/html out of exp. I decided
to do that so all the renamings can be done together, even though
the API (and that of template, for that matter) is still fluid.
Rob Pike [Thu, 3 Nov 2011 18:39:52 +0000 (11:39 -0700)]
encoding: move asn1, csv, gob, json, xml into encoding
This is Go 1 package renaming CL #1.
This one merely moves the source; the import strings will be
changed after the next weekly release.
Fumitoshi Ukai [Thu, 3 Nov 2011 03:13:39 +0000 (14:13 +1100)]
websocket: return an error HTTP response for bad websocket request.
websocket spec had changed server-side requiements to return
an HTTP response with an appropriate error code (such as 400 Bad
Request) when it finds client did not send a handshake that matches
websocket protocol, rather than just closing connection.
It needs to flush out response before closing connection.
Fixes issues 2396.
Luuk van Dijk [Wed, 2 Nov 2011 14:36:33 +0000 (15:36 +0100)]
gc: small fixes for printing.
mark OADDR inserted by typecheck as implicit
OCOPY takes ->left and ->right, not ->list
OMAKE*'s can all have arguments
precedence for OIND was initalized twice
fixes #2414
R=rsc, dave
CC=golang-dev
https://golang.org/cl/5319065
Dmitriy Vyukov [Wed, 2 Nov 2011 13:42:01 +0000 (16:42 +0300)]
runtime: unify mutex code across OSes
The change introduces 2 generic mutex implementations
(futex- and semaphore-based). Each OS chooses a suitable mutex
implementation and implements few callbacks (e.g. futex wait/wake).
The CL reduces code duplication, extends some optimizations available
only on Linux/Windows to other OSes and provides ground
for futher optimizations. Chan finalizers are finally eliminated.
Russ Cox [Wed, 2 Nov 2011 01:45:21 +0000 (21:45 -0400)]
gofix: error fix
To make the error fix more useful, expand typecheck to gather
more information about struct fields, typecheck range statements,
typecheck indirect and index of named types, and collect information
about assignment conversions.
Also, change addImport to rename top-level uses of a to-be-imported
identifier to avoid conflicts. This duplicated some of the code in
the url fix, so that fix is now shorter.
R=iant, r, r
CC=golang-dev
https://golang.org/cl/5305066
Andrew Balholm [Wed, 2 Nov 2011 00:47:05 +0000 (11:47 +1100)]
html: stop at scope marker node when generating implied </a> tags
A <a> tag generates implied end tags for any open <a> elements.
But it shouldn't do that when it is inside a table cell the the open <a>
is outside the table.
So stop the search for an open <a> when we reach a scope marker node.
Pass tests1.dat, test 78:
<a href="blah">aba<table><tr><td><a href="foo">br</td></tr>x</table>aoe
Back then, every x.go file in a package became an x.6 file
in the archive. It was important to be able to allow the
use of long Go source file names, hence the increase in size.
Today, all Go source files compile into a single _go_.6 file
regardless of their names, so the archive file name length
no longer needs to be long. The longer name causes some
problems on Plan 9, where the native archive format is the
same but with 16-byte names, so revert back to 16.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5333050
Andrew Balholm [Tue, 1 Nov 2011 00:42:54 +0000 (11:42 +1100)]
html: process </td> tags; foster parent at most one node per token
Correctly close table cell when </td> is read.
Because of reconstructing the active formatting elements, more than one
node may be created when reading a single token.
If both nodes are foster parented, they will be siblings, but the first
node should be the parent of the second.
Pass tests1.dat, test 77:
<a href="blah">aba<table><a href="foo">br<tr><td></td></tr>x</table>aoe
Scott Lawrence [Mon, 31 Oct 2011 23:07:17 +0000 (16:07 -0700)]
template: fix error checking on execute without parse
Fixed error checking in exec.go to give a sensible error message when
execution is attempted before a successful parse (rather than an
outright panic).
Luuk van Dijk [Mon, 31 Oct 2011 17:09:40 +0000 (18:09 +0100)]
gc: clean up printing.
Got rid of all the magic mystery globals. Now
for %N, %T, and %S, the flags +,- and # set a sticky
debug, sym and export mode, only visible in the new fmt.c.
Default is error mode. Handle h and l flags consistently with
the least side effects, so we can now change
things without worrying about unrelated things
breaking.
Jan Newmarch [Mon, 31 Oct 2011 15:33:14 +0000 (11:33 -0400)]
misc/emacs/go-lang.el: Fix restoration of multiple windows in a frame after gofmt
If a frame has multiple windows then the windows must all be restored
after gofmt has finished and the old windows must be restored.
Before this fix, only the Go code edit window would be left.
Dave Cheney [Sat, 29 Oct 2011 18:22:30 +0000 (14:22 -0400)]
exp/ssh: fix length header leaking into channel data streams.
The payload of a data message is defined as an SSH string type,
which uses the first four bytes to encode its length. When channelData
and channelExtendedData were added I defined Payload as []byte to
be able to use it directly without a string to []byte conversion. This
resulted in the length data leaking into the payload data.
This CL fixes the bug, and restores agl's original fast path code.
Additionally, a bug whereby s.lock was not released if a packet arrived
for an invalid channel has been fixed.
Finally, as they were no longer used, I have removed
the channelData and channelExtedendData structs.
Andrew Balholm [Fri, 28 Oct 2011 23:51:59 +0000 (10:51 +1100)]
html: adjust bookmark in "adoption agency" algorithm
In the adoption agency algorithm, the formatting element is sometimes
removed from the list of active formatting elements and reinserted at a later index.
In that case, the bookmark showing where it is to be reinserted needs to be moved,
so that its position relative to its neighbors remains the same
(and also so that it doesn't become out of bounds).
Also pass tests through test 76:
<test attribute---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->