]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agogovet: check canonical dynamic method signatures
Russ Cox [Wed, 19 Oct 2011 20:06:16 +0000 (16:06 -0400)]
govet: check canonical dynamic method signatures

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

13 years agounicode: sort tables.go
Russ Cox [Wed, 19 Oct 2011 20:02:22 +0000 (16:02 -0400)]
unicode: sort tables.go

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

13 years agocodereview: show LGTMs in hg p
Russ Cox [Wed, 19 Oct 2011 19:08:33 +0000 (15:08 -0400)]
codereview: show LGTMs in hg p

Shows first line of any response that the codereview server
has identified as an LGTM.  Example output below.

5305046:
        big: update for fmt interface changes

        Nothing terribly interesting here.

        Reviewer: gri@golang.org
                gri: LGTM
CC: golang-dev@googlegroups.com
        Files:
                src/pkg/big/int.go
                src/pkg/big/nat.go
                src/pkg/big/nat_test.go
                src/pkg/big/rat.go

5307044:
        exp/template/html: use rune

        Nothing terribly interesting here.

        Reviewer: mikesamuel@gmail.com, nigeltao@golang.org
                mikesamuel: I don't see a type def for rune.  Assuming that's a new intrinsic, LGTM.
CC: golang-dev@googlegroups.com
        Files:
                src/pkg/exp/template/html/css.go
                src/pkg/exp/template/html/css_test.go
                src/pkg/exp/template/html/html.go
                src/pkg/exp/template/html/js.go

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5297045

13 years agogotest: use $GCFLAGS like make does
Russ Cox [Wed, 19 Oct 2011 17:10:23 +0000 (13:10 -0400)]
gotest: use $GCFLAGS like make does

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5297044

13 years agoexp/types: fix crash in parseBasicType on unknown type
Russ Cox [Wed, 19 Oct 2011 16:49:01 +0000 (12:49 -0400)]
exp/types: fix crash in parseBasicType on unknown type

R=gri
CC=golang-dev
https://golang.org/cl/5302044

13 years agocrypto/x509: fix names in certificate generation.
Adam Langley [Wed, 19 Oct 2011 16:19:13 +0000 (12:19 -0400)]
crypto/x509: fix names in certificate generation.

I had a brain fart in af84b15fbae2 and messed up the names in
generated certificates.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5315046

13 years agohttp: comment tweaks
Brad Fitzpatrick [Wed, 19 Oct 2011 15:48:26 +0000 (08:48 -0700)]
http: comment tweaks

It hasn't been primitive in a while.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5287041

13 years agosyscall: update ztypes_linux_386 for terminal changes
Brad Fitzpatrick [Wed, 19 Oct 2011 15:45:38 +0000 (08:45 -0700)]
syscall: update ztypes_linux_386 for terminal changes

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/5299045

13 years agosyscall: update ztypes_linux_arm for terminal changes
Dave Cheney [Wed, 19 Oct 2011 14:38:32 +0000 (07:38 -0700)]
syscall: update ztypes_linux_arm for terminal changes

regenerated on a debian sid arm5 host.

R=bradfitz, iant
CC=golang-dev
https://golang.org/cl/5298046

13 years agoos/inotify: move to exp/inotify
Mikio Hara [Wed, 19 Oct 2011 01:54:45 +0000 (10:54 +0900)]
os/inotify: move to exp/inotify

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5295044

13 years agotag weekly.2011-10-18
Andrew Gerrand [Wed, 19 Oct 2011 00:51:32 +0000 (11:51 +1100)]
tag weekly.2011-10-18

R=golang-dev
CC=golang-dev
https://golang.org/cl/5292045

13 years agoweekly.2011-10-18 weekly.2011-10-18
Andrew Gerrand [Wed, 19 Oct 2011 00:31:57 +0000 (11:31 +1100)]
weekly.2011-10-18

R=rsc
CC=golang-dev
https://golang.org/cl/5302041

13 years agohtml: fix escape_test.go for CSS escaper change 5306042.
Nigel Tao [Tue, 18 Oct 2011 23:54:04 +0000 (10:54 +1100)]
html: fix escape_test.go for CSS escaper change 5306042.

R=mikesamuel
CC=golang-dev
https://golang.org/cl/5313044

13 years agofmt: clean up after reflect.Interface change.
Rob Pike [Tue, 18 Oct 2011 23:23:07 +0000 (16:23 -0700)]
fmt: clean up after reflect.Interface change.
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

13 years agorpc: don't panic on write error.
Rob Pike [Tue, 18 Oct 2011 22:52:49 +0000 (15:52 -0700)]
rpc: don't panic on write error.
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

13 years agoexp/template/html: fix bug in cssEscaper
Mike Samuel [Tue, 18 Oct 2011 22:01:42 +0000 (17:01 -0500)]
exp/template/html: fix bug in cssEscaper

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

13 years agohttp: add test for panic inside hijacked request
Andrew Gerrand [Tue, 18 Oct 2011 21:23:13 +0000 (08:23 +1100)]
http: add test for panic inside hijacked request

R=golang-dev, rsc, rsc
CC=golang-dev
https://golang.org/cl/5283052

13 years agohtml: parse raw text and RCDATA elements, such as <script> and <title>.
Nigel Tao [Tue, 18 Oct 2011 21:03:30 +0000 (08:03 +1100)]
html: parse raw text and RCDATA elements, such as <script> and <title>.

Pass tests1.dat, test 26:
#data
<script><div></script></div><title><p></title><p><p>
#document
| <html>
|   <head>
|     <script>
|       "<div>"
|     <title>
|       "<p>"
|   <body>
|     <p>
|     <p>

Thanks to Andy Balholm for driving this change.

R=andybalholm
CC=golang-dev
https://golang.org/cl/5301042

13 years agold: modify macho linkedit segment to enable OS X code signing
Mikkel Krautz [Tue, 18 Oct 2011 20:31:03 +0000 (16:31 -0400)]
ld: modify macho linkedit segment to enable OS X code signing

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

13 years agogodoc: generate package toc in template, not in JavaScript
Russ Cox [Tue, 18 Oct 2011 20:23:35 +0000 (16:23 -0400)]
godoc: generate package toc in template, not in JavaScript

1. Generate TOC for package pages using template,
instead of using JavaScript magic.  This makes the
pages generated by godoc -html easier to export
to other systems.

2. Make TOC one column.  It's hard to do two columns
portably without invoking JavaScript.

3. Since the TOC is only one column, show full type
signatures for functions and methods.  Many times
that's all you need to see anyway.

4. Name the section after the TOC "Overview".
Naming it something is important, to set it off
from the TOC and so that there's a quick link to
it in the TOC.

For now, some illustrative examples:

http://swtch.com:6060/pkg/io/
http://swtch.com:6060/pkg/strings/
http://swtch.com:6060/pkg/tabwriter/
http://swtch.com:6060/pkg/unicode/

Fixes #1982.

R=gri, bradfitz, r
CC=golang-dev
https://golang.org/cl/5303044

13 years agoexp/winfsnotify: filesystem watcher for Windows
Hector Chu [Tue, 18 Oct 2011 20:09:58 +0000 (21:09 +0100)]
exp/winfsnotify: filesystem watcher for Windows

R=rsc, alex.brainman, bradfitz
CC=bsiegert, go.peter.90, golang-dev
https://golang.org/cl/4188047

13 years ago5l, 6l, 8l: correct ELFRESERVE diagnostic
Anthony Martin [Tue, 18 Oct 2011 20:05:38 +0000 (16:05 -0400)]
5l, 6l, 8l: correct ELFRESERVE diagnostic

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

13 years ago6l, 8l: emit macho dwarf info before linkedit section
Mikkel Krautz [Tue, 18 Oct 2011 19:58:10 +0000 (15:58 -0400)]
6l, 8l: emit macho dwarf info before linkedit section

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5272050

13 years agobig: handle aliasing correctly for Rat.SetFrac.
Robert Griesemer [Tue, 18 Oct 2011 19:40:41 +0000 (12:40 -0700)]
big: handle aliasing correctly for Rat.SetFrac.

Fixes #2379.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5305043

13 years agogc: preserve uint8 and byte distinction in errors, import data
Russ Cox [Tue, 18 Oct 2011 18:55:50 +0000 (14:55 -0400)]
gc: preserve uint8 and byte distinction in errors, import data

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

13 years ago5g, 6g: comment out uses of -r
Russ Cox [Tue, 18 Oct 2011 18:55:28 +0000 (14:55 -0400)]
5g, 6g: comment out uses of -r

R=ken2
CC=golang-dev
https://golang.org/cl/5299043

13 years agobuild: pass $GCFLAGS to compiler
Russ Cox [Tue, 18 Oct 2011 18:55:10 +0000 (14:55 -0400)]
build: pass $GCFLAGS to compiler

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

13 years agonet: remove duplicate error information in Dial
Andrey Mirtchovski [Tue, 18 Oct 2011 18:51:40 +0000 (14:51 -0400)]
net: remove duplicate error information in Dial

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5293045

13 years agonet: allow LookupSRV on non-standard DNS names
Russ Cox [Tue, 18 Oct 2011 17:57:04 +0000 (13:57 -0400)]
net: allow LookupSRV on non-standard DNS names

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5313043

13 years agoA+C: Jani Monoses (individual CLA)
Russ Cox [Tue, 18 Oct 2011 17:56:51 +0000 (13:56 -0400)]
A+C: Jani Monoses (individual CLA)

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5297043

13 years agogodoc: fix ToAbsolute mapping
Robert Griesemer [Tue, 18 Oct 2011 17:28:30 +0000 (10:28 -0700)]
godoc: fix ToAbsolute mapping

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

13 years agohttp, crypto/tls: fix read timeouts and closing.
Adam Langley [Tue, 18 Oct 2011 16:59:32 +0000 (12:59 -0400)]
http, crypto/tls: fix read timeouts and closing.

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

13 years agoexp/terminal: split terminal handling from exp/ssh
Adam Langley [Tue, 18 Oct 2011 16:58:57 +0000 (12:58 -0400)]
exp/terminal: split terminal handling from exp/ssh

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

13 years agoexp/ssh: general cleanups for client support
Dave Cheney [Tue, 18 Oct 2011 16:54:48 +0000 (12:54 -0400)]
exp/ssh: general cleanups for client support

common.go:
* simplify findAgreedAlgorithms.
* add channelExtendedData support.

messages.go:
* add clientExtendedData.

server.go:
*  use simplified findAgreedAlgorithms.

server_shell.go:
* fix shadowed err return value.

transport.go:
* introduce separate cipher, mac and compression for each direction.
* added filteredConn and packetWriter interfaces.
* newTransport requires a source of randomness.

R=golang-dev, agl, rsc
CC=golang-dev
https://golang.org/cl/5285044

13 years agobig: more explicit documentation for div/mod/quo/rem
Robert Griesemer [Tue, 18 Oct 2011 16:45:38 +0000 (09:45 -0700)]
big: more explicit documentation for div/mod/quo/rem

Fixes #2380.

R=rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/5313041

13 years agoreflect: make unsafe use of SliceHeader gc-friendly
Russ Cox [Tue, 18 Oct 2011 14:03:37 +0000 (10:03 -0400)]
reflect: make unsafe use of SliceHeader gc-friendly

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

13 years agogofix -r mapdelete
Russ Cox [Tue, 18 Oct 2011 13:56:34 +0000 (09:56 -0400)]
gofix -r mapdelete

R=golang-dev, r, adg, r, cw
CC=golang-dev
https://golang.org/cl/5266045

13 years agogofix: add mapdelete
Russ Cox [Tue, 18 Oct 2011 13:45:36 +0000 (09:45 -0400)]
gofix: add mapdelete

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5286043

13 years agogc: add delete(m, x) but leave in m[x] = 0, false.
Russ Cox [Tue, 18 Oct 2011 13:41:32 +0000 (09:41 -0400)]
gc: add delete(m, x) but leave in m[x] = 0, false.

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

13 years agomisc/windows: automated toolchain packager
Joe Poirier [Tue, 18 Oct 2011 04:51:45 +0000 (15:51 +1100)]
misc/windows: automated toolchain packager

A first run at fully automating the process.
This CL supersedes https://golang.org/cl/4634114/
which I seemed to have lost.

R=golang-dev, alex.brainman, adg
CC=golang-dev
https://golang.org/cl/5273041

13 years agold: bump pe linker version to 3.0 to allow code signing
Mikkel Krautz [Tue, 18 Oct 2011 04:31:55 +0000 (15:31 +1100)]
ld: bump pe linker version to 3.0 to allow code signing

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

13 years agotag release.r58.2
Andrew Gerrand [Tue, 18 Oct 2011 03:10:41 +0000 (14:10 +1100)]
tag release.r58.2

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5299041

13 years agoreflect: make map test independent of map iteration order.
David Symonds [Tue, 18 Oct 2011 01:47:34 +0000 (12:47 +1100)]
reflect: make map test independent of map iteration order.

This should fix the 386 builds.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5298042

13 years agoreflect: fix test failure reporting.
David Symonds [Tue, 18 Oct 2011 01:26:09 +0000 (12:26 +1100)]
reflect: fix test failure reporting.

There's a problem that is manifesting on the 386 builders,
but this test bug is masking it.

R=adg
CC=golang-dev
https://golang.org/cl/5295042

13 years agofmt: fix test relying on map iteration order.
David Symonds [Tue, 18 Oct 2011 00:47:11 +0000 (11:47 +1100)]
fmt: fix test relying on map iteration order.

This fixes the 386 builds.

R=golang-dev, adg, r
CC=golang-dev
https://golang.org/cl/5293043

13 years agotag release.r60.3
Andrew Gerrand [Tue, 18 Oct 2011 00:35:58 +0000 (11:35 +1100)]
tag release.r60.3

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5298041

13 years agomisc/swig: delete binaries
Anthony Martin [Mon, 17 Oct 2011 23:47:52 +0000 (16:47 -0700)]
misc/swig: delete binaries

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5273045

13 years agodoc: document release.r60.3
Andrew Gerrand [Mon, 17 Oct 2011 23:43:22 +0000 (10:43 +1100)]
doc: document release.r60.3

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5267049

13 years agoscanner: invalidate scanner.Position when no token is present
Robert Griesemer [Mon, 17 Oct 2011 23:35:12 +0000 (16:35 -0700)]
scanner: invalidate scanner.Position when no token is present

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

13 years agoruntime: random offset for map iteration
Russ Cox [Mon, 17 Oct 2011 22:49:02 +0000 (18:49 -0400)]
runtime: random offset for map iteration

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5285042

13 years agoreflect: disallow Interface method on Value obtained via unexported name
Russ Cox [Mon, 17 Oct 2011 22:48:45 +0000 (18:48 -0400)]
reflect: disallow Interface method on Value obtained via unexported name

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

13 years agohtml: refactor the tokenizer; parse "</>" correctly.
Nigel Tao [Mon, 17 Oct 2011 22:42:16 +0000 (09:42 +1100)]
html: refactor the tokenizer; parse "</>" correctly.

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

13 years agoexp/template/html: do not depend on reflection on internal fields
Russ Cox [Mon, 17 Oct 2011 22:23:59 +0000 (18:23 -0400)]
exp/template/html: do not depend on reflection on internal fields

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5286049

13 years agobuild: add missing nuke target
Anthony Martin [Mon, 17 Oct 2011 21:18:21 +0000 (14:18 -0700)]
build: add missing nuke target

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5266046

13 years agogo spec: clarifying variable declaractions w/ constants
Robert Griesemer [Mon, 17 Oct 2011 19:54:18 +0000 (12:54 -0700)]
go spec: clarifying variable declaractions w/ constants

Fixes #2377.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5267048

13 years agogo spec: "delete" built-in function
Robert Griesemer [Mon, 17 Oct 2011 19:53:10 +0000 (12:53 -0700)]
go spec: "delete" built-in function

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5272045

13 years agogc: treat uintptr as potentially containing a pointer
Dmitriy Vyukov [Mon, 17 Oct 2011 19:14:07 +0000 (15:14 -0400)]
gc: treat uintptr as potentially containing a pointer
Fixes #2376

R=golang-dev, lvd, rsc
CC=golang-dev
https://golang.org/cl/5278048

13 years agohttp: do not depend on map iteration order
Russ Cox [Mon, 17 Oct 2011 18:51:54 +0000 (14:51 -0400)]
http: do not depend on map iteration order

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5284050

13 years agotemplate: do not depend on map iteration order
Russ Cox [Mon, 17 Oct 2011 18:51:45 +0000 (14:51 -0400)]
template: do not depend on map iteration order

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5268048

13 years agocsv: fix issue 2366 - overly aggressive TrimLeadingSpace
Paul Borman [Mon, 17 Oct 2011 18:10:39 +0000 (11:10 -0700)]
csv: fix issue 2366 - overly aggressive TrimLeadingSpace

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

13 years agohttp: fix panic when recovering from hijacked connection panic
Andrew Gerrand [Mon, 17 Oct 2011 04:54:36 +0000 (15:54 +1100)]
http: fix panic when recovering from hijacked connection panic

Fixes #2375.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5279049

13 years agogotest: avoid conflicts with the name of the tested package
Esko Luontola [Mon, 17 Oct 2011 03:19:02 +0000 (14:19 +1100)]
gotest: avoid conflicts with the name of the tested package

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

13 years agoA+C: Esko Luontola
Andrew Gerrand [Mon, 17 Oct 2011 03:18:04 +0000 (14:18 +1100)]
A+C: Esko Luontola

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5275050

13 years agohtml: tokenize "a < b" as one whole text token.
Nigel Tao [Sun, 16 Oct 2011 09:50:11 +0000 (20:50 +1100)]
html: tokenize "a < b" as one whole text token.

R=andybalholm
CC=golang-dev
https://golang.org/cl/5284042

13 years agoruntime: fix crash if user sets MemProfileRate=0
Dmitriy Vyukov [Sun, 16 Oct 2011 07:49:24 +0000 (10:49 +0300)]
runtime: fix crash if user sets MemProfileRate=0

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5284044

13 years agogoyacc: clean up after units
Anthony Martin [Sat, 15 Oct 2011 14:12:10 +0000 (07:12 -0700)]
goyacc: clean up after units

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5286047

13 years agosyscall: dll function load and calling changes
Alex Brainman [Sat, 15 Oct 2011 06:29:25 +0000 (17:29 +1100)]
syscall: dll function load and calling changes

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

13 years agohtml: improve parsing of comments and "bogus comments"
Andrew Balholm [Sat, 15 Oct 2011 01:22:08 +0000 (12:22 +1100)]
html: improve parsing of comments and "bogus comments"

R=nigeltao
CC=golang-dev
https://golang.org/cl/5279044

13 years agohttp: DoS protection: cap non-Handler Request.Body reads
Brad Fitzpatrick [Sat, 15 Oct 2011 00:34:07 +0000 (17:34 -0700)]
http: DoS protection: cap non-Handler Request.Body reads

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

13 years agohttp: avoid panic caused by nil URL
Anthony Martin [Sat, 15 Oct 2011 00:09:38 +0000 (17:09 -0700)]
http: avoid panic caused by nil URL

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

13 years agogodoc: updates for latest Go app-engine release.
Robert Griesemer [Fri, 14 Oct 2011 23:06:39 +0000 (16:06 -0700)]
godoc: updates for latest Go app-engine release.

R=adg
CC=golang-dev
https://golang.org/cl/5273044

13 years agodoc: add go-tour-kr, a Korean translation of A Tour of Go
Andrew Gerrand [Fri, 14 Oct 2011 21:42:31 +0000 (08:42 +1100)]
doc: add go-tour-kr, a Korean translation of A Tour of Go

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5273043

13 years agogodefs: add enum/const testdata
Dave Cheney [Fri, 14 Oct 2011 21:34:00 +0000 (17:34 -0400)]
godefs: add enum/const testdata

Also, add golden output data for linux/arm.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5256041

13 years agoxml: match Marshal's XMLName behavior in Unmarshal
Chris Farmiloe [Fri, 14 Oct 2011 21:29:54 +0000 (17:29 -0400)]
xml: match Marshal's XMLName behavior in Unmarshal

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

13 years agohttp: RoundTrippers shouldn't mutate Request
Brad Fitzpatrick [Fri, 14 Oct 2011 21:16:43 +0000 (14:16 -0700)]
http: RoundTrippers shouldn't mutate Request

Fixes #2146

R=rsc
CC=golang-dev
https://golang.org/cl/5284041

13 years agogofmt: fix //line handling
Russ Cox [Fri, 14 Oct 2011 19:54:45 +0000 (15:54 -0400)]
gofmt: fix //line handling

Fixes #2369.

R=gri
CC=golang-dev
https://golang.org/cl/5275048

13 years agobuild: stop on failed deps.bash
Russ Cox [Fri, 14 Oct 2011 19:54:36 +0000 (15:54 -0400)]
build: stop on failed deps.bash

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

13 years agold: Fixes issue 1899 ("cannot create 8.out.exe")
Jaroslavas Počepko [Fri, 14 Oct 2011 19:37:07 +0000 (20:37 +0100)]
ld: Fixes issue 1899 ("cannot create 8.out.exe")

http://code.google.com/p/go/issues/detail?id=1899

R=rsc, alex.brainman, bsiegert, hectorchu, bradfitz
CC=golang-dev
https://golang.org/cl/4978047

13 years agocrypto/x509: add code for dealing with PKIX public keys.
Adam Langley [Fri, 14 Oct 2011 19:11:21 +0000 (15:11 -0400)]
crypto/x509: add code for dealing with PKIX public keys.

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

13 years agocrypto/x509: keep the raw Subject and Issuer.
Adam Langley [Fri, 14 Oct 2011 19:06:54 +0000 (15:06 -0400)]
crypto/x509: keep the raw Subject and Issuer.

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

13 years agoasn1: accept UTF8 strings as ASN.1 ANY values
Adam Langley [Fri, 14 Oct 2011 19:06:11 +0000 (15:06 -0400)]
asn1: accept UTF8 strings as ASN.1 ANY values

R=bradfitz
CC=golang-dev
https://golang.org/cl/5172042

13 years agohttp: shut up a false Transport warning on Windows
Brad Fitzpatrick [Fri, 14 Oct 2011 18:31:00 +0000 (11:31 -0700)]
http: shut up a false Transport warning on Windows

Fixes #2057

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5269044

13 years agowebsocket: tweak hybi ReadHandshake to supports Firefox implementation
Luca Greco [Fri, 14 Oct 2011 18:27:45 +0000 (14:27 -0400)]
websocket: tweak hybi ReadHandshake to supports Firefox implementation

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

13 years agoA+C: Luca Greco (individual CLA)
Russ Cox [Fri, 14 Oct 2011 18:27:26 +0000 (14:27 -0400)]
A+C: Luca Greco (individual CLA)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5274045

13 years agogoyacc: make more gofmt-compliant
Chris Hundt [Fri, 14 Oct 2011 17:10:02 +0000 (13:10 -0400)]
goyacc: make more gofmt-compliant

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

13 years agoCONTRIBUTORS: Chris Hundt (Google CLA)
Russ Cox [Fri, 14 Oct 2011 17:09:56 +0000 (13:09 -0400)]
CONTRIBUTORS: Chris Hundt (Google CLA)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5284043

13 years agonet: skip ICMP test on Windows too unless uid 0
Brad Fitzpatrick [Fri, 14 Oct 2011 17:07:27 +0000 (10:07 -0700)]
net: skip ICMP test on Windows too unless uid 0

This test fails for me on Windows 7 64-bit non-Admin.

R=golang-dev, rsc, krautz
CC=golang-dev
https://golang.org/cl/5276048

13 years agocrypto/tls: fix broken looping code in windows root CA fetcher
Mikkel Krautz [Fri, 14 Oct 2011 16:26:38 +0000 (12:26 -0400)]
crypto/tls: fix broken looping code in windows root CA fetcher

R=alex.brainman, hectorchu, rsc
CC=golang-dev
https://golang.org/cl/5263045

13 years agosyscall: adjust Mount to accomodate stricter FS implementations.
David Anderson [Fri, 14 Oct 2011 16:19:45 +0000 (09:19 -0700)]
syscall: adjust Mount to accomodate stricter FS implementations.

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

13 years agocrypto/tls: disable root cert fetching to fix windows build
Alex Brainman [Fri, 14 Oct 2011 06:53:01 +0000 (17:53 +1100)]
crypto/tls: disable root cert fetching to fix windows build

R=golang-dev
CC=golang-dev
https://golang.org/cl/5267044

13 years agohtml: fix some tokenizer bugs with attribute key/values.
Nigel Tao [Fri, 14 Oct 2011 04:22:02 +0000 (15:22 +1100)]
html: fix some tokenizer bugs with attribute key/values.

The relevant spec sections are 13.2.4.38-13.2.4.40.
http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#attribute-value-(double-quoted)-state

R=andybalholm
CC=golang-dev
https://golang.org/cl/5262044

13 years agocrypto/tls: fetch root CA from Windows store
Mikkel Krautz [Fri, 14 Oct 2011 02:58:19 +0000 (22:58 -0400)]
crypto/tls: fetch root CA from Windows store

R=rsc
CC=golang-dev
https://golang.org/cl/5281044

13 years agogotype: move to exp/gotype per Go 1 plan
Robert Griesemer [Thu, 13 Oct 2011 23:36:53 +0000 (16:36 -0700)]
gotype: move to exp/gotype per Go 1 plan

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/5269043

13 years agogotype: fix build (update test)
Robert Griesemer [Thu, 13 Oct 2011 23:06:27 +0000 (16:06 -0700)]
gotype: fix build (update test)

R=r
CC=golang-dev
https://golang.org/cl/5277044

13 years agohtml: rewrite the tokenizer to be more consistent.
Nigel Tao [Thu, 13 Oct 2011 22:58:39 +0000 (09:58 +1100)]
html: rewrite the tokenizer to be more consistent.

Previously, the tokenizer made two passes per token. The first pass
established the token boundary. The second pass picked out the tag name
and attributes inside that boundary. This was problematic when the two
passes disagreed. For example, "<p id=can't><p id=won't>" caused an
infinite loop because the first pass skipped everything inside the
single quotes, and recognized only one token, but the second pass never
got past the first '>'.

This change rewrites the tokenizer to use one pass, accumulating the
boundary points of token text, tag names, attribute keys and attribute
values as it looks for the token endpoint.

It should still be reasonably efficient: text, names, keys and values
are not lower-cased or unescaped (and converted from []byte to string)
until asked for.

One of the token_test test cases was fixed to be consistent with
html5lib. Three more test cases were temporarily disabled, and will be
re-enabled in a follow-up CL. All the parse_test test cases pass.

R=andybalholm, gri
CC=golang-dev
https://golang.org/cl/5244061

13 years agogofix: make fix order explicit
Russ Cox [Thu, 13 Oct 2011 22:45:38 +0000 (18:45 -0400)]
gofix: make fix order explicit

Also test only specific fixes, not all fixes.
This means we don't have to keep updating old
test cases to match later changes to the library.

I had to adjust some of the reflect test cases,
because they were implicitly testing
reflect+oserrorstring, not just reflect.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5283042

13 years agogo/types: move to exp/types per Go 1 plan
Robert Griesemer [Thu, 13 Oct 2011 22:41:48 +0000 (15:41 -0700)]
go/types: move to exp/types per Go 1 plan

This package is only used by gotype at the moment.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5266042

13 years agogc: disallow close on receive-only channels
Russ Cox [Thu, 13 Oct 2011 20:58:04 +0000 (16:58 -0400)]
gc: disallow close on receive-only channels

Fixes #2353.
Fixes #2246.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5282042

13 years agocrypto/tls: more Unix root certificate locations
Russ Cox [Thu, 13 Oct 2011 20:17:15 +0000 (16:17 -0400)]
crypto/tls: more Unix root certificate locations

Hard work done by
http://mercurial.selenic.com/wiki/CACertificates

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5276043

13 years agoruntime: run goroutines during init
Russ Cox [Thu, 13 Oct 2011 19:54:23 +0000 (15:54 -0400)]
runtime: run goroutines during init

Fixes #583.
Fixes #1776.
Fixes #2001.
Fixes #2112.

R=golang-dev, bradfitz, r, gri
CC=golang-dev
https://golang.org/cl/5265044