The original intention was to simplify the parser, in making it skip
all comment tokens. However, checking that the Go html package is
100% compatible with the WebKit HTML test suite requires parsing the
comments. There is no longer any real benefit for the option.
R=gri, andybalholm
CC=golang-dev
https://golang.org/cl/5321043
This CL replaces the Cmd type with a Session type representing
interactive channels. This lays the foundation for supporting
other kinds of channels like direct-tcpip or x11.
client.go:
* replace chanlist map with slice.
* generalize stdout and stderr into a single type.
* unexport ClientChan to clientChan.
doc.go:
* update ServerConfig/ServerConn documentation.
* update Client example for Session.
message.go:
* make channelExtendedData more like channelData.
session.go:
* added Session which replaces Cmd.
R=agl, rsc, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5302054
The WebKit test data shows attributes as though they were child nodes:
<a X>0<b>1<a Y>2
dumps as:
| <html>
| <head>
| <body>
| <a>
| x=""
| "0"
| <b>
| "1"
| <b>
| <a>
| y=""
| "2"
So we need to do the same when dumping a tree to compare with it.
R=nigeltao
CC=golang-dev
https://golang.org/cl/5322044
Implement the foster-parenting algorithm for content that is inside a table
but not in a cell.
Also fix a bug in reconstructing the active formatting elements.
Pass test 30 in tests1.dat:
<a><table><td><a><table></table><a></tr><a></table><b>X</b>C<a>Y
R=nigeltao
CC=golang-dev
https://golang.org/cl/5309052
The additional test case in parse_test.go is:
<select><b><option><select><option></b></select>X
R=andybalholm
CC=golang-dev
https://golang.org/cl/5293051
- no explicit API change, but new(big.Rat) now creates a big.Rat value
of 0 that is immediately usable, in sync. w/ the conventions elsewhere
- various cleanups along the way
R=r
CC=golang-dev
https://golang.org/cl/5301056
Also:
- changed semantics of return values for [Int|Rat].SetString
if an error occured (returned value is nil); will expose
hidden errors where return values are not checked
- added more tests
- various cleanups throughout
Fixes#2384.
R=r
CC=golang-dev
https://golang.org/cl/5312044
Because gotest's args are mingled with the tests, it's
hard to get the usage message to print. This CL adds
explicit support for -help, spelled several different ways.
Gotest has special flags like -file that are somewhat
hidden otherwise.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5298052
server.go/channel.go:
* rename Server to ServerConfig to match Client.
* rename ServerConnection to ServeConn to match Client.
* add Listen/Listener.
* ServerConn.Handshake(), general cleanups.
client.go:
* fix bug where fmt.Error was not assigned to err
R=rsc, agl
CC=golang-dev
https://golang.org/cl/5265049
The first additional test case in parse_test.go is:
<!--><div>--<!-->
The second one is unrelated to the comment change, but also passes:
<p><hr></p>
R=andybalholm
CC=golang-dev
https://golang.org/cl/5299047
Adds check that, for example, a Scan method taking
a first argument of type fmt.ScanState has the correct
signature to satisfy fmt.Scanner.
Similarly, a ReadByte should return byte, os.Error.
These are important to check because various pieces
of code (fmt, gob, json, flate) do dynamic checks
for these methods, so code with incorrect signatures
would not be flagged at compile time.
These become even more important to check when
rune is introduced.
R=r
CC=golang-dev
https://golang.org/cl/5305044
Makes tables.go output consistent across maketable runs.
(It was already inconsistent across architectures; the new
map iteration order just make it inconsistent across runs.)
R=r
CC=golang-dev
https://golang.org/cl/5303046
Store the reflect.Value in the internal print state. Code is simpler, cleaner,
and a little faster - back to what it was before the change.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5299046
The mechanism to record the error in the call is already in place.
Fixes#2382.
R=golang-dev, dsymonds, bradfitz, r
CC=golang-dev
https://golang.org/cl/5307043
cssEscaper escapes using the CSS convention: `\` + hex + optional-space
It outputs the space when the escape could be followed by
a hex digit to distinguish a "\na" from "\u00aa".
It did not output a space when the escape is followed by a space
character so did not distinguish "\n " from "\n".
Currently when doing lookahead, it does not distinguish spaces that
will be escaped later by the same function from ones that will not.
This is correct but suboptimal.
R=nigeltao
CC=golang-dev
https://golang.org/cl/5306042
Move string table to the end of the __LINKEDIT segment.
This change allows Apple's codesign(1) utility to successfully sign
Go binaries, as long as they don't contain DWARF data (-w flag to
8l/6l). This is because codesign(1) expects the string table to be
the last part of the file.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5271050
If the length of the interpreter string
pushes us over the ELFRESERVE limit, the
resulting error message will be comical.
I was doing some ELF tinkering with a
modified version of 8l when I hit this.
To be clear, the stock linkers wouldn't
hit this without adding about forty more
section headers. We're safe for now. ;)
Also, remove a redundant call to cflush.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5268044
There is no semantic change here, just better errors.
If a function says it takes a byte, and you pass it an int,
the compiler error now says that you need a byte, not
that you need a uint8.
Groundwork for rune.
R=ken2
CC=golang-dev
https://golang.org/cl/5300042
For example, if you are debugging an optimization
problem you can now run
GCFLAGS=-N gotest
This is a convention for make, not for the general build,
so it may go away or be done differently in the eventual
'go' command.
The plan is that people will be able to test their code for
rune safety by doing GCFLAGS=-r.
R=golang-dev, bradfitz, lvd
CC=golang-dev
https://golang.org/cl/5294042
The implementation of splitFirst was broken;
splitFirst("foo/") must be the same as splitFirst("foo").
As a result, ToAbsolute could be simplified, and as a side
effect this fixes a long-standing bug.
Thanks to Luca Greco <luca.greco@alcacoop.it> for doing
the investigation.
Fixes#1157.
R=rsc
CC=golang-dev
https://golang.org/cl/5278050
tls.Conn.Close() didn't close the underlying connection and tried to
do a handshake in order to send the close notify alert.
http didn't look for errors from the TLS handshake.
Fixes#2281.
R=bradfitz
CC=golang-dev
https://golang.org/cl/5283045
This change splits terminal handling from exp/ssh, as suggested
several times in the ssh code review.
shell.go and shell_test.go are copies from exp/ssh with minimal
changes, so don't need another full review. A future CL will remove
that code from exp/ssh.
R=bradfitz, r, dave, rsc
CC=golang-dev
https://golang.org/cl/5278049
Revert workaround in compiler and
revert test for compiler workaround.
Tested that the 386 build continues to fail if
the gc change is made without the reflect change.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5312041
The old m[x] = 0, false syntax will be deleted
in a month or so, once people have had time to
change their code (there is a gofix in a separate CL).
R=ken2
CC=golang-dev
https://golang.org/cl/5265048
The Windows signtool.exe thinks our binaries are 'invalid
Win32 programs' unless the PE linker version field is 3.0
or greater.
This minor change makes it possible to successfully sign
gc-built binaries on Windows.
R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5268045
scanner.Position is the position of the most recently
scanned token. Make sure it is invalid if there is no
token scanned and update corresponding comment. This
is particularly important when reporting errors.
Fixes#2371.
R=r
CC=golang-dev
https://golang.org/cl/5294041
Had been allowing it for use by fmt, but it is too hard to lock down.
Fix other packages not to depend on it.
R=r, r
CC=golang-dev
https://golang.org/cl/5266054
Previously, Next would call either nextText or nextTag, but nextTag
could also call nextText. Both nextText and nextTag were responsible
for detecting "</a" end tags and "<!" comments. This change simplifies
the call chain and puts that responsibility in a single place.
R=andybalholm
CC=golang-dev
https://golang.org/cl/5263050
Address the issue coalescing two records together when TrimLeadingSpace
is set to true.
The input
a,b,
c,d,e
Would result with a singled a,b,c,d,e record.
With TrailingComma set to true it should give two records.
With TrailingComma set to false it should be an error.
Fixes#2366.
R=golang-dev, go.peter.90, r
CC=golang-dev
https://golang.org/cl/5284046
Uses a generic solution of renaming the tested package, instead of
using cryptic names for all other imports, variables and methods
in the generated _testmain.go file.
Fixes#2346.
R=golang-dev, r, adg
CC=golang-dev, rsc
https://golang.org/cl/5254061
New DLL and Proc types to manage and call dll functions. These were
used to simplify syscall tests in runtime package. They were also
used to implement LazyDLL and LazyProc.
LazyProc, like Proc, now have Call function, that just a wrapper for
SyscallN. It is not as efficient as Syscall, but easier to use.
NewLazyDLL now supports non-ascii filenames.
LazyDLL and LazyProc now have Load and Find methods. These can be used
during runtime to discover if some dll functions are not present.
All dll functions now return errors that fit os.Error interface. They
also contain Windows error number.
Some of these changes are suggested by jp.
R=golang-dev, jp, rsc
CC=golang-dev
https://golang.org/cl/5272042
Previously, if an http.Handler didn't fully consume a
Request.Body before returning and the request and the response
from the handler indicated no reason to close the connection,
the server would read an unbounded amount of the request's
unread body to advance past the request message to find the
next request's header. That was a potential DoS.
With this CL there's a threshold under which we read
(currently 256KB) in order to keep the connection in
keep-alive mode, but once we hit that, we instead
switch into a "Connection: close" response and don't
read the request body.
Fixes#2093 (along with number of earlier CLs)
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5268043
The current code will panic if an invalid
request (one with a nil URL) is passed to
the doFollowingRedirects function.
Also, remove a redundant nil Header check.
R=bradfitz
CC=golang-dev
https://golang.org/cl/5270046
When xml.Marshal is called on a struct it will happily
reflect the information in the "tag" of an XMLName member
regardless of the type to give the struct a tag-name in
it's XML form. This is backed up by the documentation which
says:
However xml.Unmarshal *does* care about the XMLName field
being of type xml.Name, and currently returns the error
"field XMLName does not have type xml.Name" if you have it
set to something else.
This is firstly inconsistant with xml.Marshal but it also
makes it impossible to use xml.Marshal alongside other
Marshallers (like json/bson) without poluting the state's
namespace with XMLName fields. Inorder to exclude fields
from other Marshallers the convention has been started to
tag fields as "omitempty"; which will cause the field not
to display if it is at it's "zero" state, XMLName cannot
have such as zero-state since it is a struct, so it is nicer
to use a pointer/bool value for XMLName so it can be easily
excluded when I want to Marshal my struct by some other
wire format.
Attached is the proposed minor change, that simply stops
erring if it can't set the name on the XMLName field, which
is just optional metadata anyway.
Fixes#2265.
R=rsc
CC=golang-dev
https://golang.org/cl/5067044
Apparently some versions of bash do the ||exit implicitly
when in set -e mode, but others do not. ???
R=gri
CC=golang-dev
https://golang.org/cl/5285043
We also have functions for dealing with PKCS#1 private keys. This
change adds functions for PKIX /public/ keys. Most of the time one
won't be parsing them because they usually come in certificates, but
marshaling them happens and I've previously copied the code from
x509.go for this.
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5286042
X509 names, like everything else X509, are ludicrously general. This
change keeps the raw version of the subject and issuer around for
matching. Since certificates use a distinguished encoding, comparing
the encoding is the same as comparing the values directly. This came
up recently when parsing the NSS built-in certificates which use the
raw subject and issuer for matching trust records to certificates.
R=bradfitz
CC=golang-dev
https://golang.org/cl/5275047
Firefox Websocket implementation send a "Connection: keep-alive, upgrade"
header during the handshake (and as descripted on the last hybi draft
the "Connection" header must include, but doesn't need to be equal to,
"upgrade":
'4. A "Connection" header field that includes the token "Upgrade",
treated as an ASCII case-insensitive value.'
From:
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17#page-23
R=golang-dev, ukai, cw, rsc
CC=golang-dev
https://golang.org/cl/5233059
Adjust goyacc.go to produce code that is gofmt-compliant whenever it is easy to do so. Also changed two lines in cpyact that appeared to be bugs.
Also updated units.y to remove a few other errors.
After this change, units.go has only two style errors: an extra newline at the top of the file, and yys misaligned in yySymType.
R=rsc
CC=golang-dev
https://golang.org/cl/5265047
Notably, the "data" argument should be nil if no options are
given, or (at least) the cgroup filesystem will refuse to
mount.
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5147047