Doing a socket/listen on an unspecified address with an unspecified
address family is likely to result in an AF_INET6 socket on an IPv6
capable system, which under OpenBSD means IPv6 only - not IPv4 *and*
IPv6. In this case trying to connect to this socket from an IPv4
loopback address is not going to end well.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4807057
When the encoder was updated to respect the ",omitempty"
struct tag options, the decoder half was never updated to know
about the new struct tag format. (the format is now an optional
name, followed by zero or more ",option" strings)
This only affected people who used ",omitempty" along with
a field name. In that case, the serialized JSON wouldn't
decode to the original value.
R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/4965049
This introduces new APIs.
- DialConfig can open client connection using Config, so user can specify protocol version, tls.Config if necessary.
- Message can be used to send/receive text/binary data in a frame.
- JSON can be used to send/receive JSON data in a frame.
R=golang-dev, adg, rsc, m, tarmigan, raul.san, yohcop
CC=golang-dev
https://golang.org/cl/4635084
Write to image.*.Pix directly in the case of RGB, RGBA and NRGBA
images. For the latter two, the file format matches the memory layout
so a simple copy can be used.
RGB image before/after:
tiff.BenchmarkDecoder 748137 ns/op (62.39 MB/s) 251256 ns/op (185.76 MB/s) x3.0
NRGBA image before/after:
tiff.BenchmarkDecoder 775540 ns/op (80.12 MB/s) 116721 ns/op (532.34 MB/s) x6.6
R=nigeltao
CC=golang-dev
https://golang.org/cl/4929046
- implemented stand-alone Throttle mechanism
- added new flag -index_throttle to godoc
- index throttling enables index creation when running
godoc on app engine as it keeps godoc responsive
R=rsc, dsymonds, adg
CC=golang-dev
https://golang.org/cl/4963043
This fixes goinstall so it doesn't try to install unneeded
packages or get confused with non-existent loops.
R=golang-dev, adg, gustavo
CC=golang-dev
https://golang.org/cl/4958046
This makes decimal a good test
case for the escape analysis.
With escape analysis:
benchmark old ns/op new ns/op delta
BenchmarkAtof64Decimal 1954 243 -87.56%
BenchmarkAtof64Float 2008 293 -85.41%
BenchmarkAtof64FloatExp 10106 8814 -12.78%
BenchmarkAtof64Big 5113 3486 -31.82%
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4861042
#include "go.h" (or "gg.h")
becomes
#include <u.h>
#include <libc.h>
#include "go.h"
so that go.y can #include <stdio.h>
after <u.h> but before "go.h".
This is necessary on Plan 9.
R=ken2
CC=golang-dev
https://golang.org/cl/4971041
The following testcases now pass:
`<a href=x` tests that we do not error on partial unquoted attrs.
`<a href=x ` tests that spaces do end unquoted attrs on spaces.
`<a href=''` tests that we recognize the end of single quoted attrs.
`<a href=""` tests that we recognize the end of double quoted attrs.
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/4932051
Pow10 failed for MinInt32 (endless loop until out of
memory). Fix by returning 0 and +Inf for all arguments
where the result is not representable in a float64.
Fixes#2159.
R=rsc
CC=golang-dev
https://golang.org/cl/4930041
For now it's switch-on-and-offable with -s, and the effects can be inspected
with -m. Defaults are the old codepaths.
R=rsc
CC=golang-dev
https://golang.org/cl/4634073
My theory is that suse has larger TCP buffer sizes
by default. I now check over 100MB, rather than over 2MB.
100MB is ~halfway between the 1MB limit and the 200MB
request that's attempted.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4926048
This allows code that wants to handle
[]byte separately to get at the actual slice
instead of just at individual bytes.
It seems to come up often enough.
R=r
CC=golang-dev
https://golang.org/cl/4942051
A side-effect is that, just like foo_386.go
is only built on 386, foo_386_test.go is only
built for testing on 386.
R=adg, r, mattn.jp
CC=golang-dev
https://golang.org/cl/4942050
The kludge is targeted at broken web browsers
like Chrome and IE, but it gets in the way of
sending 400 or 500-series error results with
formatted bodies in response to AJAX requests
made by pages executing in those browsers.
Now the AJAX cases will work and Chrome
and IE will be as broken with Go servers as
they are with all the other servers.
Fixes#2169.
R=bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/4930047
CL 4938041 made some incorrect changes to the filter
function which caused a different doc/codelab/wiki/index.html
file to be generated.
Added FilterFileExports and FilterPackageExports function.
Same as the existing FileExpors/PackageExports functions
but using shared code. The old functions will be removed
in the next CL.
R=r, rsc
CC=golang-dev
https://golang.org/cl/4932048
When a line directive was encountered we would push a new 'z' entry into
the history to indicate the start of new file attributation, and a 'Z'
entry to change line numbering. However we didn't pop the 'z' entry, so
we were actually corrupting the history stack. The most obvious
occurance of this was in the code that build the symbol tables for the
DWARF information - where an internal stack in the linker would overflow
when more than a few line directives were encountered in a single stack
(Issue 1878). So now we pop the 'z' entry when we encounter the end of
the file that the directive was in, which maintains the history stack
integrity.
Also, although new 'z' entries for new files had relative paths
expanded, the same was not done for line directives. Now we do it for
line directives also - so that the now correct DWARF information has the
full path available.
Fixes#1878.
R=rsc
CC=golang-dev
https://golang.org/cl/4938042
Introduce extra scope for the variable declared by a
TypeSwitchGuard so that it doesn't conflict with vars
declared by the initial SimpleStmt of a type switch.
This is a replacement for CL 4896053 which caused
a build breakage.
Also:
- explicitly detect type switches (as opposed to detecting
expression switches and then do extra testing for type switches)
- fix all outstanding TODOs in parser.go
- ran all tests
R=rsc
CC=golang-dev
https://golang.org/cl/4914044
This adds http.MaxBytesReader, similar to io.LimitReader,
but specific to http, and for preventing a class of DoS
attacks.
This also makes the 10MB ParseForm limit optional (if
not already set by a MaxBytesReader), documents it,
and also adds "PUT" as a valid verb for parsing forms
in the request body.
Improves issue 2093 (DoS protection)
Fixes#2165 (PUT form parsing)
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4921049
Make the stack traces more readable for new
Go programmers while preserving their utility for old hands.
- Change status number [4] to string.
- Elide frames in runtime package (internal details).
- Swap file:line and arguments.
- Drop 'created by' for main goroutine.
- Show goroutines in order of allocation:
implies main goroutine first if nothing else.
There is no option to get the extra frames back.
Uncomment 'return 1' at the bottom of symtab.c.
$ 6.out
throw: all goroutines are asleep - deadlock!
goroutine 1 [chan send]:
main.main()
/Users/rsc/g/go/src/pkg/runtime/x.go:22 +0x8a
goroutine 2 [select (no cases)]:
main.sel()
/Users/rsc/g/go/src/pkg/runtime/x.go:11 +0x18
created by main.main
/Users/rsc/g/go/src/pkg/runtime/x.go:19 +0x23
goroutine 3 [chan receive]:
main.recv(0xf8400010a0, 0x0)
/Users/rsc/g/go/src/pkg/runtime/x.go:15 +0x2e
created by main.main
/Users/rsc/g/go/src/pkg/runtime/x.go:20 +0x50
goroutine 4 [chan receive (nil chan)]:
main.recv(0x0, 0x0)
/Users/rsc/g/go/src/pkg/runtime/x.go:15 +0x2e
created by main.main
/Users/rsc/g/go/src/pkg/runtime/x.go:21 +0x66
$
$ 6.out index
panic: runtime error: index out of range
goroutine 1 [running]:
main.main()
/Users/rsc/g/go/src/pkg/runtime/x.go:25 +0xb9
$
$ 6.out nil
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x22ca]
goroutine 1 [running]:
main.main()
/Users/rsc/g/go/src/pkg/runtime/x.go:28 +0x211
$
$ 6.out panic
panic: panic
goroutine 1 [running]:
main.main()
/Users/rsc/g/go/src/pkg/runtime/x.go:30 +0x101
$
R=golang-dev, qyzhai, n13m3y3r, r
CC=golang-dev
https://golang.org/cl/4907048
The Go version has 64 character long section names; originally,
in Plan 9, the limit was 16. To provide compatibility, this
change allows the input length to be either the target length
or the earlier option. The section name is extended with spaces
where required.
This has been tested to work without regressions in the
Go environment, testing the older alternative has not been
possible yet.
R=rsc
CC=golang-dev
https://golang.org/cl/4650071
Add support for syscalls on openbsd amd64. This is based on the
existing freebsd amd64 implementation.
R=mikioh.mikioh, rsc, yourcomputerpal
CC=golang-dev
https://golang.org/cl/4798060
The EXTERN lines in elf.h already define these.
That's not a problem for most C compilers, but
apparently it is for some copies of the OS X linker.
Fixes#2167.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/4936044
ast.FilterFile(src, ast.IsExported) has the same
effect as ast.FileExports(src) with this change.
1st step towards removing FileExports - it is
just a special case of FilterFile with this CL.
Added corresponding test.
R=r
CC=golang-dev
https://golang.org/cl/4938041
maketables.go/tables.go
- Properly set combinesForward flag for JamoL and JamoV.
- Fixed Printf bug.
composition.go
- Make insertString use the same control flow as insert.
- Better Hangul and non-Hangul mixing.
forminfo.go
- Fixed bug in compBoundaryBefore that affected a few esoteric cases.
- Buffer overflow now tested in normalize_test.go (other CL).
R=r
CC=golang-dev
https://golang.org/cl/4924041
- templates should be read before any handlers are started
- for app engine use, must use underlying file system to read templates
R=r
CC=golang-dev
https://golang.org/cl/4928042
In the process, rewrite index.go to use slices instead
of vectors, rewrite for-loops into range loops, and
generally simplify code (this code was written before
the launch of go and showed its age).
Also, fix a wrong import in appinit.go.
No significant performance changes (improvements);
most of time is spent elsewhere (measured on an stand-
alone MacBook Pro with SSD disk, running standard
godoc settings: godoc -v -http=:7777 -index).
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4875056
ParseMediaType previously documented that it always returned
a non-nil map, but also documented that it returned a nil map
to signal an error.
That is confusing, contradictory and not Go-like.
Now it returns (mediatype string, params map, os.Error).
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4867054
The subtle AST changes introduced with CL 4896053
broke type checking of type switches in gofix.
Coming up with a correct fix will take some time.
Undoing this change for now.
««« original CL description
go/parser: fix type switch scoping
The variable declared by a TypeSwitchGuard must be
visible in each TypeCaseClause and must not conflict
with other variables declared by the initial SimpleStmt
of a type switch.
Also:
- explicitly detect type switches (as opposed to detecting
regular (expression switches) and then do extra testing
for type switches
- fix all outstanding TODOs in parser.go
R=rsc
CC=golang-dev
https://golang.org/cl/4896053
»»»
R=rsc
CC=golang-dev
https://golang.org/cl/4902052
The variable declared by a TypeSwitchGuard must be
visible in each TypeCaseClause and must not conflict
with other variables declared by the initial SimpleStmt
of a type switch.
Also:
- explicitly detect type switches (as opposed to detecting
regular (expression switches) and then do extra testing
for type switches
- fix all outstanding TODOs in parser.go
R=rsc
CC=golang-dev
https://golang.org/cl/4896053
This CL changes both JoinGroup and LeaveGroup methods
to take an interface as an argument for enabling IPv6
group address join/leave, join a group address on a
specific interface.
R=rsc, dave
CC=golang-dev
https://golang.org/cl/4815074
Allocate Defer on stack during cgo calls, as suggested
by dvyukov. Also includes some comment corrections.
benchmark old,ns/op new,ns/op
BenchmarkCgoCall 669 330
(Intel Xeon CPU 1.80GHz * 4, Linux 386)
R=dvyukov, rsc
CC=golang-dev
https://golang.org/cl/4910041
This defines just enough context to distinguish HTML URI attributes
from parsed character data.
It does not affect any public module API as I thought I would get
early comment on style for defining enumerations and tables.
R=rsc, r, nigeltao, r
CC=golang-dev
https://golang.org/cl/4906043
All tests enabled by default passes except those in timeout_test.go.
For TestLookupPort, add an entry for "bootps" in /lib/ndb/common
(Plan 9 calls it "bootp"). I've sent out a patch to fix this.
R=paulzhol, rsc, mikioh.mikioh
CC=ality, golang-dev
https://golang.org/cl/4779041