]> Cypherpunks repositories - gostls13.git/log
gostls13.git
14 years agohttp: fix typo in URL.String doc comment.
David Symonds [Fri, 6 May 2011 17:00:50 +0000 (10:00 -0700)]
http: fix typo in URL.String doc comment.

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

14 years agowingui: fix Makefile after rename
Alex Brainman [Fri, 6 May 2011 07:15:46 +0000 (17:15 +1000)]
wingui: fix Makefile after rename

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

14 years agocrypto/tls: export the verified chains.
Adam Langley [Thu, 5 May 2011 17:44:36 +0000 (13:44 -0400)]
crypto/tls: export the verified chains.

The verified chains are the chains that were actually verified.

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

14 years agocrypto/x509: export raw SubjectPublicKeyInfo.
Adam Langley [Thu, 5 May 2011 17:37:42 +0000 (13:37 -0400)]
crypto/x509: export raw SubjectPublicKeyInfo.

The SPKI will probably be used for identifying public keys in future
HSTS specs.

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

14 years agoimage: make AlphaColor.Set conform to usual signature
Roger Peppe [Thu, 5 May 2011 17:16:59 +0000 (10:16 -0700)]
image: make AlphaColor.Set conform to usual signature

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

14 years agogo spec: newlines cannot be used inside a char or "" string literal
Robert Griesemer [Thu, 5 May 2011 16:03:00 +0000 (09:03 -0700)]
go spec: newlines cannot be used inside a char or "" string literal

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

14 years agoimage/tiff: implement a decoder.
Benny Siegert [Thu, 5 May 2011 03:52:55 +0000 (20:52 -0700)]
image/tiff: implement a decoder.

The current iteration can decode 8-bit images in
grayscale, paletted, RGB, RGBA and NRGBA mode. LZW compression
is implemented but does not work on my test images.
Deflate (i.e. zlib) compression with or without a horizontal
predictor is supported.

R=nigeltao, nigeltao_gnome
CC=golang-dev, mpl
https://golang.org/cl/4240051

14 years agoimage/png: support encoding of paletted images with alpha channel.
Dmitry Chestnykh [Thu, 5 May 2011 03:46:27 +0000 (20:46 -0700)]
image/png: support encoding of paletted images with alpha channel.

Encoder now writes tRNS chunk for non-opaque paletted images.
CL includes new test images (basn3a08-trns.[ps]ng).

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

14 years agohttp/spdy: add type to FlagClearPreviouslyPersistedSettings constant
Ross Light [Wed, 4 May 2011 19:01:33 +0000 (15:01 -0400)]
http/spdy: add type to FlagClearPreviouslyPersistedSettings constant

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

14 years agoexp/draw: fast paths for drawing a YCbCr or an NRGBA onto an RGBA.
Nigel Tao [Wed, 4 May 2011 17:17:53 +0000 (10:17 -0700)]
exp/draw: fast paths for drawing a YCbCr or an NRGBA onto an RGBA.

On my laptop, I had an 800x600 jpeg and an 800x600 png (with
transparency). I timed how long it took to draw each image onto an
equivalently sized, zeroed RGBA image.

Previously, the jpeg took 75ms and the png took 70ms, going through
the medium-fast path, i.e. func drawRGBA in draw.go.

After this CL, the jpeg took 14ms, and the png took 21ms with the
Over operator and 12ms with the Src operator.

It's only a rough estimate basd on one image file, but it should
give an idea of the order of magnitude of improvement.

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

14 years agotag release.r57.1
Russ Cox [Wed, 4 May 2011 04:26:20 +0000 (00:26 -0400)]
tag release.r57.1

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

14 years agodoc: document r57.1
Russ Cox [Wed, 4 May 2011 04:14:07 +0000 (00:14 -0400)]
doc: document r57.1

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

14 years agohttp: fix FormFile nil pointer dereference on missing multipart form
Andrew Gerrand [Wed, 4 May 2011 03:45:10 +0000 (20:45 -0700)]
http: fix FormFile nil pointer dereference on missing  multipart form

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

14 years agonet: disable dnsmsg_test on windows
Alex Brainman [Wed, 4 May 2011 03:08:36 +0000 (13:08 +1000)]
net: disable dnsmsg_test on windows

R=golang-dev, bradfitzwork
CC=golang-dev
https://golang.org/cl/4466041

14 years agomake.bash: remove old bash version of gotest on Windows
Alex Brainman [Wed, 4 May 2011 01:16:55 +0000 (11:16 +1000)]
make.bash: remove old bash version of gotest on Windows

The file is called gotest.exe now.

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

14 years agohttp: improve a test
Brad Fitzpatrick [Tue, 3 May 2011 18:25:35 +0000 (11:25 -0700)]
http: improve a test

Should prevent failures on slow machines, such as:
http://godashboard.appspot.com/log/47b5cae591b7ad8908704e327f3b9b41945d7d5fecfc0c8c945d5545ece1a813

Verified the change (on a fast machine) by removing the
existing sleep, in which case the race happens ~50% of the
time with GOMAXPROCS > 1, but recovers gracefully with
retries.

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

14 years agotag release.r57 step 2
Russ Cox [Tue, 3 May 2011 18:12:46 +0000 (14:12 -0400)]
tag release.r57 step 2

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

14 years agotag release.r57
Russ Cox [Tue, 3 May 2011 18:12:02 +0000 (14:12 -0400)]
tag release.r57

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

14 years agodoc: release.r57
Russ Cox [Tue, 3 May 2011 17:55:50 +0000 (13:55 -0400)]
doc: release.r57

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

14 years agogofmt: update test.sh (exclude a file w/ incorrect syntax)
Robert Griesemer [Tue, 3 May 2011 16:56:18 +0000 (09:56 -0700)]
gofmt: update test.sh (exclude a file w/ incorrect syntax)

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

14 years agocodereview: add release branch support
Russ Cox [Tue, 3 May 2011 14:39:11 +0000 (10:39 -0400)]
codereview: add release branch support

Note that if you are working on the upcoming release
branch you have to point your extension path to a
copy of lib/codereview/codereview.py that won't change
as the repository flips between release-branch and default branch.
This warning should only apply to this one branch and only to rsc,
but you never know.

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

14 years agoreflect: allow unexported key in Value.MapIndex
Russ Cox [Tue, 3 May 2011 14:38:37 +0000 (10:38 -0400)]
reflect: allow unexported key in Value.MapIndex

Fixes #1748.

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

14 years agonet: don't crash on unexpected DNS SRV responses
Brad Fitzpatrick [Tue, 3 May 2011 14:10:48 +0000 (07:10 -0700)]
net: don't crash on unexpected DNS SRV responses

Fixes #1350

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

14 years agoMake.cmd: create TARGDIR if necessary
Gustavo Niemeyer [Tue, 3 May 2011 12:53:04 +0000 (09:53 -0300)]
Make.cmd: create TARGDIR if necessary

Fixes #1771.

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

14 years agold: make ELF binaries with no shared library dependencies static binaries
Russ Cox [Tue, 3 May 2011 05:56:23 +0000 (01:56 -0400)]
ld: make ELF binaries with no shared library dependencies static binaries

$ file $GOROOT/bin/{godoc,goyacc}
/home/rsc/g/go/bin/godoc:  ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not strpped
/home/rsc/g/go/bin/goyacc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
$

Fixes #1758.

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

14 years agodoc/install: specify clone -u instead of -r
Andrew Gerrand [Tue, 3 May 2011 03:40:47 +0000 (20:40 -0700)]
doc/install: specify clone -u instead of -r

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

14 years agoos: remove race paranoia from Environ(); it's guarded now
Brad Fitzpatrick [Tue, 3 May 2011 03:08:27 +0000 (23:08 -0400)]
os: remove race paranoia from Environ(); it's guarded now

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

14 years agogodoc: if there is no search box, don't run the respective JS code
Robert Griesemer [Tue, 3 May 2011 01:07:11 +0000 (18:07 -0700)]
godoc: if there is no search box, don't run the respective JS code

Fixes a JS crash which prevented the automatically generated
table of contents to not appear.

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

14 years agogo spec: clarify semantics of integer division
Robert Griesemer [Tue, 3 May 2011 00:23:18 +0000 (17:23 -0700)]
go spec: clarify semantics of integer division

Fixes #1764.

R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/4431082

14 years agoimage: fix build
Rob Pike [Mon, 2 May 2011 22:42:46 +0000 (15:42 -0700)]
image: fix build
accidentally deleted one method
TBR=rsc

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

14 years agoimage: add type-specific Set methods and use them when decoding PNG.
Rob Pike [Mon, 2 May 2011 22:10:37 +0000 (15:10 -0700)]
image: add type-specific Set methods and use them when decoding PNG.
This speeds up PNG decode about 20% by avoiding per-pixel interface conversions.

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

14 years agohttp/pprof: fix POST reading bug
Russ Cox [Mon, 2 May 2011 21:34:22 +0000 (17:34 -0400)]
http/pprof: fix POST reading bug

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

14 years agonet: default to 127.0.0.1, not localhost, in TestICMP
Brad Fitzpatrick [Mon, 2 May 2011 21:22:40 +0000 (14:22 -0700)]
net: default to 127.0.0.1, not localhost, in TestICMP

If localhost resolves to ::1, the IPv4-only test fails.

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

14 years agoruntime: maybe fix Windows build broken by cgo setenv CL
Brad Fitzpatrick [Mon, 2 May 2011 20:35:28 +0000 (13:35 -0700)]
runtime: maybe fix Windows build broken by cgo setenv CL

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

14 years agogodoc: added -index flag to enable/disable search index
Robert Griesemer [Mon, 2 May 2011 20:28:02 +0000 (13:28 -0700)]
godoc: added -index flag to enable/disable search index

Fixes #1647.

R=adg, rsc1, r2, rsc, r
CC=golang-dev
https://golang.org/cl/4444083

14 years agohttp: fix racy test with a simpler version
Brad Fitzpatrick [Mon, 2 May 2011 20:01:36 +0000 (13:01 -0700)]
http: fix racy test with a simpler version

This was seen breaking the slow arm5 builder:
http://godashboard.appspot.com/log/ec54ee302a70c07093e8f5c47454b3eb48768b77e1d8cc7943d8951f8b6696be

The test was unnecessarily complex and didn't benefit from
using httptest.Server. That just got in the way.

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

14 years agoos: make Setenv update C environment variables
Brad Fitzpatrick [Mon, 2 May 2011 19:38:13 +0000 (12:38 -0700)]
os: make Setenv update C environment variables

Fixes #1569

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

14 years agomisc/cgo/test: run tests
Russ Cox [Mon, 2 May 2011 17:55:51 +0000 (13:55 -0400)]
misc/cgo/test: run tests

The new gotest ignores Test functions outside *_test.go files
(the old shell script allowed them), so replace one clumsy hack
with another.

The root problem is that the package makefiles only know
how to run cgo for source files in the package proper, not
for test files.  Making it work for test files is probably more
trouble than it's worth.

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

14 years agogo/printer: make tests follow syntactic restrictions
Robert Griesemer [Mon, 2 May 2011 17:05:43 +0000 (10:05 -0700)]
go/printer: make tests follow syntactic restrictions

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

14 years agogo/token: faster FileSet.Position implementation
Robert Griesemer [Mon, 2 May 2011 16:17:46 +0000 (09:17 -0700)]
go/token: faster FileSet.Position implementation

- added a cache for last file looked up: avoids binary
  search if the file matches

- don't look up extra line info if not present
  (it is almost never present)

- inline one critical binary search call (inlining
  provides almost 30% improvement in this case)

Together, these changes make the go/printer benchmark
more than twice as fast (53% improvement). gofmt also
sped up by about the same amount.

Also: removed an unused internal field from FileSet.

Measurements (always best of 5 runs):

* original:
  printer.BenchmarkPrint     5    238354200 ns/op (100%)

* using last file cache:
  printer.BenchmarkPrint    10    201796600 ns/op (85%)

* avoiding lookup of extra line info:
  printer.BenchmarkPrint    10    157072700 ns/op (66%)

* inlining a critical binary search call:
  printer.BenchmarkPrint    10    111523500 ns/op (47%)

gofmt (always best of 3 runs):

* before:
  time gofmt -l src misc
  real 0m33.316s
  user 0m31.298s
  sys 0m0.319s

* after:
  time gofmt -l src misc
  real 0m15.889s
  user 0m14.596s
  sys 0m0.224s

R=r, dfc, bradfitz, rsc1
CC=golang-dev
https://golang.org/cl/4433086

14 years agogo spec: restricted expressions may still be parenthesized
Robert Griesemer [Mon, 2 May 2011 16:16:31 +0000 (09:16 -0700)]
go spec: restricted expressions may still be parenthesized

No language change.

- added a few examples with parentheses
- added a corresponding sentence to assignments
  (this explicitly permits: (_) = 0, currently allowed by 6g,
  gofmt, but marked as an error by gccgo).

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

14 years ago5a, 6a, 8a, cc: remove old environment variables
Russ Cox [Mon, 2 May 2011 15:24:32 +0000 (11:24 -0400)]
5a, 6a, 8a, cc: remove old environment variables

Uses of $INCLUDE and $NPROC are left over from Plan 9.
Remove them to avoid causing confusion.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4445079

14 years agomultipart: add FileName accessor on Part
Brad Fitzpatrick [Mon, 2 May 2011 15:14:31 +0000 (08:14 -0700)]
multipart: add FileName accessor on Part

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

14 years agonet: enable SO_REUSEPORT on BSD variants
Mikio Hara [Mon, 2 May 2011 14:50:12 +0000 (10:50 -0400)]
net: enable SO_REUSEPORT on BSD variants

Fixes #1694.

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

14 years agonet: fix ipv6 test
Mikio Hara [Mon, 2 May 2011 14:49:42 +0000 (10:49 -0400)]
net: fix ipv6 test

Fixes #1767.

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

14 years agoruntime, sync/atomic: fix arm cas
Russ Cox [Mon, 2 May 2011 14:49:19 +0000 (10:49 -0400)]
runtime, sync/atomic: fix arm cas

Works around bug in kernel implementation on old ARM5 kernels.
Bug was fixed on 26 Nov 2007 (between 2.6.23 and 2.6.24) but
old kernels persist.

Fixes #1750.

R=dfc, golang-dev
CC=golang-dev
https://golang.org/cl/4436072

14 years agojpeg: speed up RGBA encoding ~%50
Brad Fitzpatrick [Mon, 2 May 2011 14:26:40 +0000 (07:26 -0700)]
jpeg: speed up RGBA encoding ~%50

Avoids image.At(), color.RGBA(), opposing 8 bit shifts,
and min function calls in a loop.  Not as pretty as before,
but the pure version is still there to revert back to
later if/when the compiler gets better.

before (best of 5)
jpeg.BenchmarkEncodeRGBOpaque   50   64781360 ns/op   18.97 MB/s

after (best of 5)
jpeg.BenchmarkEncodeRGBOpaque   50   42044300 ns/op   29.23 MB/s

(benchmarked on an HP z600; 16 core Xeon E5520 @ 2.27Ghz)

R=r, r2, nigeltao
CC=golang-dev
https://golang.org/cl/4433088

14 years agopng: speed up opaque RGBA encoding
Brad Fitzpatrick [Mon, 2 May 2011 14:25:53 +0000 (07:25 -0700)]
png: speed up opaque RGBA encoding

With Linux/8g on a 2006 Mac Mini (1.66 GHz Intel Core Duo,
2KB L1, 2MB L2, 2G main memory), GOMAXPROCS unset:

start:
png.BenchmarkEncodePaletted       50   44772820 ns/op
png.BenchmarkEncodeRGBOpaque       10  208395900 ns/op
png.BenchmarkEncodeRGBA        5  331088000 ns/op

remove interface method calls:
png.BenchmarkEncodePaletted       50   44722880 ns/op
png.BenchmarkEncodeRGBOpaque       10  139042600 ns/op
png.BenchmarkEncodeRGBA        5  334033600 ns/op

flate inline min/max():
png.BenchmarkEncodePaletted       50   40631180 ns/op
png.BenchmarkEncodeRGBOpaque       10  124894900 ns/op
png.BenchmarkEncodeRGBA        5  312099000 ns/op

after adler change:
png.BenchmarkEncodePaletted       50   40181760 ns/op
png.BenchmarkEncodeRGBOpaque       20  121781950 ns/op
png.BenchmarkEncodeRGBA        5  313890800 ns/op

In comparison to 121 ms on this 2006 machine, on my
Core2 Duo 2.66 GHz laptop, the final BenchmarkEncodeRGBOpaque
runs in 27 ms. (these are all for 640x480 images)

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

14 years agomultipart: return an error on Reader EOF, not (nil, nil)
Brad Fitzpatrick [Mon, 2 May 2011 01:23:39 +0000 (18:23 -0700)]
multipart: return an error on Reader EOF, not (nil, nil)

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

14 years agosyscall: add Windows file mapping functions and constants
Evan Shaw [Sun, 1 May 2011 23:35:55 +0000 (09:35 +1000)]
syscall: add Windows file mapping functions and constants

R=brainman, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4375046

14 years agohttp: rename ErrBodyReadAferClose to ErrBodyReadAfterClose
Andrew Gerrand [Sun, 1 May 2011 19:37:20 +0000 (12:37 -0700)]
http: rename ErrBodyReadAferClose to ErrBodyReadAfterClose

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

14 years agomime/multipart: fix regression from previous ReadSlice change
Brad Fitzpatrick [Sun, 1 May 2011 02:54:36 +0000 (19:54 -0700)]
mime/multipart: fix regression from previous ReadSlice change

The previous change to make multipart use ReadSlice out of
paranoia broke multipart to not deal with large lines in
the bodies.

We should only be paranoid about long lines in the header
sections.

Fixes http://code.google.com/p/camlistore/issues/detail?id=4

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

14 years agohttp: new error for reading a body after it's been closed
Brad Fitzpatrick [Sun, 1 May 2011 02:54:08 +0000 (19:54 -0700)]
http: new error for reading a body after it's been closed

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

14 years agogo/parser: accept parenthesized receive operations in select statements
Robert Griesemer [Fri, 29 Apr 2011 20:06:03 +0000 (13:06 -0700)]
go/parser: accept parenthesized receive operations in select statements

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

14 years agoundo CL 4428057 / 19e540fc7d7d
Robert Griesemer [Fri, 29 Apr 2011 19:20:31 +0000 (12:20 -0700)]
undo CL 4428057 / 19e540fc7d7d

The CL introduces inconsistencies with respect to
the use of parentheses/grouping of receive operations.

««« original CL description
spec: narrow syntax for expression and select statements

This is not a language change, it simply expresses the
accepted cases explicitly in the respective productions.

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/4428057
»»»

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4444080

14 years agoimage: png & jpeg encoding benchmarks
Brad Fitzpatrick [Fri, 29 Apr 2011 17:42:44 +0000 (10:42 -0700)]
image: png & jpeg encoding benchmarks

No code changes in this CL.

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

14 years agohttp/cgi: pass down environment variables for irix and solaris
Ian Lance Taylor [Fri, 29 Apr 2011 17:38:07 +0000 (10:38 -0700)]
http/cgi: pass down environment variables for irix and solaris

Used by gccgo.

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

14 years agospec: narrow syntax for expression and select statements
Robert Griesemer [Fri, 29 Apr 2011 16:49:10 +0000 (09:49 -0700)]
spec: narrow syntax for expression and select statements

This is not a language change, it simply expresses the
accepted cases explicitly in the respective productions.

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

14 years agohttp/cgi: correctly set request Content-Type
Evan Shaw [Fri, 29 Apr 2011 14:04:28 +0000 (07:04 -0700)]
http/cgi: correctly set request Content-Type

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

14 years agogo/printer: added simple performance benchmark
Robert Griesemer [Fri, 29 Apr 2011 00:06:34 +0000 (17:06 -0700)]
go/printer: added simple performance benchmark

R=r, dfc, bradfitzwork, bradfitz
CC=golang-dev
https://golang.org/cl/4441078

14 years agocgi: set Request.TLS and Request.RemoteAddr for children
Brad Fitzpatrick [Thu, 28 Apr 2011 22:02:32 +0000 (15:02 -0700)]
cgi: set Request.TLS and Request.RemoteAddr for children

R=agl, eds, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4432079

14 years agocgi: export RequestFromMap
Evan Shaw [Thu, 28 Apr 2011 20:30:53 +0000 (13:30 -0700)]
cgi: export RequestFromMap

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

14 years agohttp/spdy: new package
Ross Light [Thu, 28 Apr 2011 20:11:37 +0000 (13:11 -0700)]
http/spdy: new package

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

14 years agoxml: fix reflect error
Russ Cox [Thu, 28 Apr 2011 19:43:42 +0000 (15:43 -0400)]
xml: fix reflect error

Fixes #1749.

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

14 years agohttp: update cookie doc to reference new RFC 6265
Brad Fitzpatrick [Thu, 28 Apr 2011 18:36:06 +0000 (11:36 -0700)]
http: update cookie doc to reference new RFC 6265

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

14 years agosyslog: fix skipping of net tests
Gustavo Niemeyer [Thu, 28 Apr 2011 17:16:41 +0000 (14:16 -0300)]
syslog: fix skipping of net tests

Also remove some left over copy & paste
in the test of reflect.Copy for arrays.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4431074

14 years agogc: preserve original expression for errors
Russ Cox [Thu, 28 Apr 2011 17:14:35 +0000 (13:14 -0400)]
gc: preserve original expression for errors

Fixes #1722.

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

14 years agohttp: add Header.Write method
Evan Shaw [Thu, 28 Apr 2011 07:16:15 +0000 (00:16 -0700)]
http: add Header.Write method

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

14 years agotag weekly.2011-04-27
Andrew Gerrand [Thu, 28 Apr 2011 06:38:01 +0000 (16:38 +1000)]
tag weekly.2011-04-27

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

14 years agoweekly.2011-04-27 weekly.2011-04-27
Andrew Gerrand [Thu, 28 Apr 2011 06:32:51 +0000 (16:32 +1000)]
weekly.2011-04-27

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

14 years agohttp: add MultipartForm, FormFile, and ParseMultipartForm to Request
Andrew Gerrand [Thu, 28 Apr 2011 05:21:54 +0000 (15:21 +1000)]
http: add MultipartForm, FormFile, and ParseMultipartForm to Request

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

14 years agoadler32: speed up ~40% by avoiding bounds checks
Brad Fitzpatrick [Thu, 28 Apr 2011 04:36:11 +0000 (21:36 -0700)]
adler32: speed up ~40% by avoiding bounds checks

before & after:
adler32.BenchmarkGolden   100000      14747 ns/op
adler32.BenchmarkGolden   200000       8761 ns/op

Found by profiling PNG encoding.

R=rsc, bradfitzwork, eds
CC=golang-dev
https://golang.org/cl/4441073

14 years agoruntime: fix typo in gc bug fix
Russ Cox [Thu, 28 Apr 2011 04:20:37 +0000 (00:20 -0400)]
runtime: fix typo in gc bug fix

This time for sure.

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

14 years agogc: correctly handle fields of pointer type to recursive forward references
Lorenzo Stoakes [Thu, 28 Apr 2011 04:13:49 +0000 (00:13 -0400)]
gc: correctly handle fields of pointer type to recursive forward references

Previously, whether declaring a type which copied the structure of a type it was referenced in via a pointer field would work depended on whether you declared it before or after the type it copied, e.g. type T2 T1; type T1 struct { F *T2 } would work, however type T1 struct { F *T2 }; type T2 T1 wouldn't.

Fixes #667.

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

14 years agoruntime: stack split + garbage collection bug
Russ Cox [Thu, 28 Apr 2011 03:21:12 +0000 (23:21 -0400)]
runtime: stack split + garbage collection bug

The g->sched.sp saved stack pointer and the
g->stackbase and g->stackguard stack bounds
can change even while "the world is stopped",
because a goroutine has to call functions (and
therefore might split its stack) when exiting a
system call to check whether the world is stopped
(and if so, wait until the world continues).

That means the garbage collector cannot access
those values safely (without a race) for goroutines
executing system calls.  Instead, save a consistent
triple in g->gcsp, g->gcstack, g->gcguard during
entersyscall and have the garbage collector refer
to those.

The old code was occasionally seeing (because of
the race) an sp and stk that did not correspond to
each other, so that stk - sp was not the number of
stack bytes following sp.  In that case, if sp < stk
then the call scanblock(sp, stk - sp) scanned too
many bytes (anything between the two pointers,
which pointed into different allocation blocks).
If sp > stk then stk - sp wrapped around.
On 32-bit, stk - sp is a uintptr (uint32) converted
to int64 in the call to scanblock, so a large (~4G)
but positive number.  Scanblock would try to scan
that many bytes and eventually fault accessing
unmapped memory.  On 64-bit, stk - sp is a uintptr (uint64)
promoted to int64 in the call to scanblock, so a negative
number.  Scanblock would not scan anything, possibly
causing in-use blocks to be freed.

In short, 32-bit platforms would have seen either
ineffective garbage collection or crashes during garbage
collection, while 64-bit platforms would have seen
either ineffective or incorrect garbage collection.
You can see the invalid arguments to scanblock in the
stack traces in issue 1620.

Fixes #1620.
Fixes #1746.

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

14 years agocgo: handle versioned ELF symbols
Russ Cox [Thu, 28 Apr 2011 03:21:03 +0000 (23:21 -0400)]
cgo: handle versioned ELF symbols

Fixes #1397.

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

14 years agoruntime: allow use of >512 MB on 32-bit platforms
Russ Cox [Thu, 28 Apr 2011 03:20:53 +0000 (23:20 -0400)]
runtime: allow use of >512 MB on 32-bit platforms

runtime: memory allocated by OS not in usable range
runtime: out of memory: cannot allocate 1114112-byte block (2138832896 in use)
throw: out of memory

runtime.throw+0x40 /Users/rsc/g/go/src/pkg/runtime/runtime.c:102
        runtime.throw(0x1fffd, 0x101)
runtime.mallocgc+0x2af /Users/rsc/g/go/src/pkg/runtime/malloc.c:60
        runtime.mallocgc(0x100004, 0x0, 0x1, 0x1, 0xc093, ...)
runtime.mal+0x40 /Users/rsc/g/go/src/pkg/runtime/malloc.c:289
        runtime.mal(0x100004, 0x20bc4)
runtime.new+0x26 /Users/rsc/g/go/src/pkg/runtime/malloc.c:296
        runtime.new(0x100004, 0x8fe84000, 0x20bc4)
main.main+0x29 /Users/rsc/x.go:11
        main.main()
runtime.mainstart+0xf /Users/rsc/g/go/src/pkg/runtime/386/asm.s:93
        runtime.mainstart()
runtime.goexit /Users/rsc/g/go/src/pkg/runtime/proc.c:178
        runtime.goexit()
----- goroutine created by -----
_rt0_386+0xbf /Users/rsc/g/go/src/pkg/runtime/386/asm.s:80

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

14 years agomime/multipart: add ReadForm and associated types
Andrew Gerrand [Thu, 28 Apr 2011 03:14:35 +0000 (13:14 +1000)]
mime/multipart: add ReadForm and associated types

R=brad_danga_com, rsc, dfc, r, dchest, bradfitz
CC=golang-dev
https://golang.org/cl/4439075

14 years agotar: use ioutil.Discard
Brad Fitzpatrick [Wed, 27 Apr 2011 22:57:22 +0000 (15:57 -0700)]
tar: use ioutil.Discard

This one didn't come up in previous greps.

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

14 years agoioutil: add Discard, update tree.
Brad Fitzpatrick [Wed, 27 Apr 2011 22:47:04 +0000 (15:47 -0700)]
ioutil: add Discard, update tree.

This also removes an unnecessary allocation in
http/transfer.go

R=r, rsc1, r2, adg
CC=golang-dev
https://golang.org/cl/4426066

14 years agohttp: put a limit on POST size
Brad Fitzpatrick [Wed, 27 Apr 2011 22:36:39 +0000 (15:36 -0700)]
http: put a limit on POST size

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

14 years agohttp: keep gzip reader inside eofsignaler
Brad Fitzpatrick [Wed, 27 Apr 2011 21:23:25 +0000 (14:23 -0700)]
http: keep gzip reader inside eofsignaler

Fixes #1725

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

14 years agoreflect: Fix Copy of arrays
Gustavo Niemeyer [Wed, 27 Apr 2011 21:22:53 +0000 (18:22 -0300)]
reflect: Fix Copy of arrays

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4438077

14 years agocgi: improve Location response handling
Brad Fitzpatrick [Wed, 27 Apr 2011 21:07:13 +0000 (14:07 -0700)]
cgi: improve Location response handling

Add local URI path support, which isn't as fringe
as I originally thought. (it's supported by Apache)

Send an implicit 302 status on redirects (not 200).

Fixes #1597

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

14 years agoruntime: fix mkversion to output valid path separators
Peter Mundy [Wed, 27 Apr 2011 19:47:12 +0000 (15:47 -0400)]
runtime: fix mkversion to output valid path separators

In a GOROOT path a backslash is a path separator
not an escape character. For example, `C:\go`.
Fixes gotest error:
version.go:3: unknown escape sequence: g

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

14 years agohttp/fcgi: New package
Evan Shaw [Wed, 27 Apr 2011 19:34:34 +0000 (12:34 -0700)]
http/fcgi: New package

R=golang-dev, bradfitzgo, bradfitzwork, nigeltao, rog
CC=golang-dev
https://golang.org/cl/4271078

14 years agotutorial: replace the forever loops with finite counts in sieve programs.
Rob Pike [Wed, 27 Apr 2011 16:59:27 +0000 (09:59 -0700)]
tutorial: replace the forever loops with finite counts in sieve programs.
Fixes #1742.
I hope.

Also this picks up an update to go_tutorial.html that should already have happened.

R=brainman, rsc, peterGo
CC=golang-dev
https://golang.org/cl/4452050

14 years agogopack: preserve safe flag when not adding unsafe objects to archive
Russ Cox [Wed, 27 Apr 2011 13:20:53 +0000 (09:20 -0400)]
gopack: preserve safe flag when not adding unsafe objects to archive

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

14 years agodoc: mention make version in install.html
Russ Cox [Wed, 27 Apr 2011 01:39:22 +0000 (21:39 -0400)]
doc: mention make version in install.html

Fixes #1531.

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

14 years agogoinstall: support GOPATH; building and installing outside the Go tree
Andrew Gerrand [Wed, 27 Apr 2011 01:00:34 +0000 (11:00 +1000)]
goinstall: support GOPATH; building and installing outside the Go tree

For example, with GOPATH set like so
        GOPATH=/home/adg/gocode
And after creating some subdirectories
        mkdir /home/adg/gocode/{bin,pkg,src}

I can use goinstall to install the github.com/nf/goto web server,
which depends on the github.com/nf/stat package, with
        goinstall github.com/nf/goto

This downloads and installs all dependencies (that aren't already
installed) like so
        /home/adg/gocode/bin/goto
        /home/adg/gocode/pkg/darwin_amd64/github.com/nf/stat.a
        /home/adg/gocode/src/github.com/nf/goto/...
        /home/adg/gocode/src/github.com/nf/stat/...

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

14 years agobuilder: build multiple targets in parallel
Andrew Gerrand [Wed, 27 Apr 2011 00:12:10 +0000 (10:12 +1000)]
builder: build multiple targets in parallel

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

14 years agorpc: run benchmarks over HTTP as well as direct network connections.
Rob Pike [Tue, 26 Apr 2011 23:16:51 +0000 (16:16 -0700)]
rpc: run benchmarks over HTTP as well as direct network connections.

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

14 years agorpc: allow the argument (first arg of method) to be a value rather than a pointer.
Rob Pike [Tue, 26 Apr 2011 22:07:25 +0000 (15:07 -0700)]
rpc: allow the argument (first arg of method) to be a value rather than a pointer.
Can make the API nicer in some cases.

R=rsc, rog, r2
CC=golang-dev
https://golang.org/cl/4428064

14 years agohttp: new tests + panic hunting issue 1725
Brad Fitzpatrick [Tue, 26 Apr 2011 19:32:59 +0000 (12:32 -0700)]
http: new tests + panic hunting issue 1725

No bugs found yet, though.

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

14 years agocrypto/x509: memorize chain building.
Adam Langley [Tue, 26 Apr 2011 14:26:22 +0000 (10:26 -0400)]
crypto/x509: memorize chain building.

I ran the new verification code against a large number of certificates
with a huge (>1000) number of intermediates.

I had previously convinced myself that a cycle in the certificate
graph implied a cycle in the hash graph (and thus, a contradiction).
This is bogus because the signatures don't cover each other.

Secondly, I managed to drive the verification into a time explosion
with a fully connected graph of certificates. The code would try to
walk the factorial number of paths.

This change switches the CertPool to dealing with indexes of
certificates rather than pointers: this makes equality easy. (I didn't
want to compare pointers because a reasonable gc could move objects
around over time.)

Secondly, verification now memorizes the chains from a given
certificate. This is dynamic programming for the lazy, but there's a
solid reason behind it: dynamic programming would ignore the Issuer
hints that we can exploit by walking up the chain rather than down.

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

14 years agosyscall: Mlock, Munlock, Mlockall, Munlockall on Linux.
Albert Strasheim [Tue, 26 Apr 2011 13:41:19 +0000 (06:41 -0700)]
syscall: Mlock, Munlock, Mlockall, Munlockall on Linux.

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

14 years agoruntime: more graceful out-of-memory crash
Russ Cox [Tue, 26 Apr 2011 12:25:40 +0000 (08:25 -0400)]
runtime: more graceful out-of-memory crash

Used to fault trying to access l->list->next
when l->list == nil after MCentral_AllocList.
Now prints

runtime: out of memory: no room in arena for 65536-byte allocation (536870912 in use)
throw: out of memory

followed by stack trace.

Fixes #1650.

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

14 years agoos: fix race in ReadAt/WriteAt on Windows
Alex Brainman [Tue, 26 Apr 2011 08:09:46 +0000 (18:09 +1000)]
os: fix race in ReadAt/WriteAt on Windows

R=bradfitzgo, rsc, peterGo
CC=golang-dev
https://golang.org/cl/4441051

14 years ago8l: do not emit empty dwarf pe sections
Alex Brainman [Tue, 26 Apr 2011 07:12:16 +0000 (17:12 +1000)]
8l: do not emit empty dwarf pe sections

This change will allow to generate valid executable,
even if rsc disables dwarf generation, as it happend
at revision 9a64273f9d68.

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

14 years agohttp: make Client redirect policy configurable
Brad Fitzpatrick [Tue, 26 Apr 2011 05:41:50 +0000 (22:41 -0700)]
http: make Client redirect policy configurable

Work on issue 155

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