1
0
mirror of https://github.com/golang/go synced 2024-10-04 14:31:21 -06:00
Commit Graph

3910 Commits

Author SHA1 Message Date
Mike Rosset
af8b1271eb archive/tar: when writing tar Headers write hdr.Linkname
This should allow symlinks in tar files. Where previously
as far as I can see they were skipped completely.

R=golang-dev, dsymonds, rsc, bradfitz, bradfitz
CC=golang-dev, mike.rosset
https://golang.org/cl/4973044
2011-08-29 11:01:03 -07:00
Joel Sing
1075af0cce runtime: add openbsd 386 defs.h
Missed in previous change (4951043).

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4967044
2011-08-29 11:07:19 -04:00
Russ Cox
3693cd2988 runtime: add runtime· prefix to showframe
R=ken2
CC=golang-dev
https://golang.org/cl/4978042
2011-08-29 10:55:21 -04:00
Mikio Hara
683df29f7c net: change the internal form of IPMask for IPv4
This CL changes the internal form of IPMask for IPv4
from 16-byte to 4-byte, also adds Size method to IPMask
struct and changes output string format of IPMask.String
method.

R=rsc
CC=golang-dev
https://golang.org/cl/4950046
2011-08-29 10:49:03 -04:00
Gustavo Niemeyer
1952eb5010 os: fix WNOHANG Waitmsg
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4962042
2011-08-29 10:45:37 -04:00
Joel Sing
9ef17990c2 runtime: add runtime support for openbsd 386
Add openbsd 386 runtime support, partially based on the existing
freebsd 386 runtime.

This requires change 4973043.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4951043
2011-08-29 10:42:16 -04:00
Yuval Pavel Zholkover
c20a338c2f runtime, syscall: use the vdso page on linux x86 for faster syscalls instead of int $0x80.
8l: fix handling CALL $(constant) code generated by 8a.
8a,8l: add indirect call instruction: CALL *data(SB).

R=rsc, iant
CC=golang-dev
https://golang.org/cl/4817054
2011-08-29 10:36:06 -04:00
Joel Sing
88e984faa5 syscall: add openbsd 386
Add openbsd 386 syscall support, partially based on the existing
freebsd 386 syscall implementation.

FTR zerrors_openbsd_386.go cannot currently be completely built on
openbsd/i386 due to what appears to be a gcc bug. The constants can be
successfully generated with -m32 on openbsd/amd64 and the error
table can then be generated on openbsd/i386.

R=rsc
CC=golang-dev
https://golang.org/cl/4969045
2011-08-29 10:04:28 -04:00
Joel Sing
8aa2591b13 runtime: openbsd thread tweaks
- Rename sys_sched_yield() to osyield() as this is now defined in asm.h.
- Only print kern.rtheads message if rfork_thread() failed with ENOTSUP.
- Remove unused variables.

R=rsc
CC=golang-dev
https://golang.org/cl/4973043
2011-08-29 09:35:13 -04:00
Fazlul Shahriar
45bd7b07e5 time: fix Plan 9 build
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4966045
2011-08-29 09:35:08 -04:00
Hector Chu
0f5902d6be runtime: fix stack cleanup on windows/amd64
In amd64 it is the caller who cleans the stack.

R=alex.brainman, vcc.163, jp
CC=golang-dev
https://golang.org/cl/4966046
2011-08-29 22:12:56 +10:00
Rob Pike
361c5ace05 template: range over channel
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4951046
2011-08-29 15:56:52 +10:00
Jaroslavas Počepko
f627215bab runtime: go interface to cdecl calbacks
cdecl calbacks have been implemented in C/ASM code, just Go function is missing

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/4969047
2011-08-29 10:40:28 +10:00
Russ Cox
db5f9da425 gc: tweak and enable escape analysis
-s now means *disable* escape analysis.

Fix escape leaks for struct/slice/map literals.
Add ... tracking.
Rewrite new(T) and slice literal into stack allocation when safe.

Add annotations to reflect.
Reflect is too chummy with the compiler,
so changes like these affect it more than they should.

R=lvd, dave, gustavo
CC=golang-dev
https://golang.org/cl/4954043
2011-08-28 12:05:00 -04:00
Alex Brainman
2a80882601 runtime: use cgo runtime functions to call windows syscalls
R=rsc
CC=golang-dev, jp, vcc.163
https://golang.org/cl/4926042
2011-08-27 23:17:00 +10:00
Russ Cox
91643acc6f mime: fix build
The fix is to add ' ' after ';' so that we match
what we used to generate.
Packages like http look for the string with
the space in it, and I don't see a reason to
be so terse.

Also s/buffer/b/

TBR=bradfitz
CC=golang-dev
https://golang.org/cl/4959044
2011-08-26 17:19:52 -04:00
Hector Chu
75199664d9 io: add TeeReader
TeeReader is a Reader that writes what it reads.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4953041
2011-08-26 17:08:59 -04:00
Pascal S. de Kloe
bd3627cd7d mime: text charset defaults
Enforce + document the UTF-8 default.

R=rsc, bradfitz, adg
CC=golang-dev
https://golang.org/cl/4627049
2011-08-26 16:55:25 -04:00
Pascal S. de Kloe
fbdbb595b6 mime: media type formatter
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4654069
2011-08-26 16:55:18 -04:00
Wei Guangjing
e753512e2d cgo: fixes callback for windows amd64
R=rsc
CC=golang-dev
https://golang.org/cl/4826041
2011-08-26 16:43:37 -04:00
Albert Strasheim
582f6d4fd7 syscall: Handle RTM_NEWROUTE in ParseNetlinkRouteAttr on Linux.
R=mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/4954047
2011-08-26 15:38:42 -04:00
Joel Sing
d130611f45 net: disable "tcp" test on openbsd
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
2011-08-26 15:38:02 -04:00
Russ Cox
75d337e84b time: fix zone during windows test
Factor out sleep interrupt.

Fixes #1109.

R=alex.brainman, go.peter.90, mattn.jp
CC=golang-dev
https://golang.org/cl/4968041
2011-08-26 15:15:23 -04:00
Ross Light
4541fa96b3 xml: marshal "parent>child" tags correctly
Fixes #2119

R=m.n.summerfield, adg, kevlar, rsc, gustavo, n13m3y3r
CC=golang-dev
https://golang.org/cl/4941042
2011-08-26 12:29:52 -03:00
Brad Fitzpatrick
396cd36179 json: fix decode bug with struct tag names with ,opts being ignored
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
2011-08-26 12:27:33 +04:00
Brad Fitzpatrick
822804c600 http: support setting Transport's TLS client config
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4964043
2011-08-26 10:06:35 +04:00
Rob Pike
a45c657db1 bytes.Buffer: clarify that NewBuffer is not for beginners
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4965048
2011-08-26 15:09:23 +10:00
Fumitoshi Ukai
ebf19fb171 websocket: Implements new version of WebSocket protocol.
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
2011-08-26 13:12:08 +10:00
Yasuhiro Matsumoto
7a3095121e syscall: SOMAXCONN should be 0x7fffffff at winsock2.
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/4955042
2011-08-26 12:36:46 +10:00
Benny Siegert
64c9c7f5de image/tiff: decoder optimization.
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
2011-08-26 11:36:52 +10:00
Benny Siegert
f172338a15 image/tiff: add a decode benchmark.
R=nigeltao
CC=golang-dev
https://golang.org/cl/4917049
2011-08-26 11:31:59 +10:00
Gustavo Niemeyer
77db5ff501 go/build: separate test imports out when scanning
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
2011-08-25 21:00:20 -03:00
Mikio Hara
825f8c147a net: move internal string manipulation routines to parse.go
R=rsc
CC=golang-dev
https://golang.org/cl/4968044
2011-08-25 19:22:46 -04:00
Mikio Hara
78963f4f1d net: make use of IPv4len, IPv6len
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4957043
2011-08-25 19:00:04 -04:00
Russ Cox
cb51fdc007 strconv: put decimal on stack
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
2011-08-25 17:54:14 -04:00
Bill Neubauer
948418f16a template: Grammar fix for template documentation.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4944043
2011-08-25 12:25:19 -04:00
Dave Cheney
8511ed454a http: return 413 instead of 400 when the request body is too large
RFC2616 says servers should return this status code when
rejecting requests that are too large.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14

R=bradfitz
CC=golang-dev
https://golang.org/cl/4962041
2011-08-25 14:00:00 +04:00
Nigel Tao
1f0d277cc1 exp/template/html: add some tests for ">" attributes.
R=mikesamuel
CC=golang-dev
https://golang.org/cl/4956042
2011-08-25 13:48:21 +10:00
Mike Samuel
42a56d3e81 exp/template/html: Reworked escapeText to recognize attr boundaries.
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
2011-08-25 11:24:43 +10:00
Andrew Gerrand
56f948470e bufio: handle a "\r\n" that straddles the buffer.
Fixes #2164.

R=r, rsc
CC=golang-dev
https://golang.org/cl/4927043
2011-08-25 08:44:12 +10:00
Evan Shaw
de20cec9c9 big: fix nat.scan bug
Scanning "0" with detected base did not actually set the nat to 0.

R=gri
CC=golang-dev
https://golang.org/cl/4923050
2011-08-24 14:55:03 -07:00
Volker Dobler
f78e7d36a6 math: fix Pow10 loop
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
2011-08-24 13:59:52 -04:00
Mikio Hara
80f79ad305 net: make use of IPv4len, IPv6len
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4926046
2011-08-24 13:59:33 -04:00
Brad Fitzpatrick
fa6d038e98 http: adjust test threshold for larger suse buffers
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
2011-08-24 16:09:49 +04:00
Brad Fitzpatrick
bb4cf3f351 http: on invalid request, send 400 response
Fixes #2160

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4930049
2011-08-24 13:10:22 +04:00
Marcel van Lohuizen
4a4fa38d0e exp/norm: Reduced the size of the byte buffer used by reorderBuffer by half by reusing space when combining.
R=r
CC=golang-dev
https://golang.org/cl/4939042
2011-08-24 11:05:45 +02:00
Russ Cox
00d64c7239 reflect: add Value.Bytes, Value.SetBytes methods
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
2011-08-23 22:50:08 -04:00
Russ Cox
66bedf8221 go/build: add test support & use in gotest
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
2011-08-23 22:45:30 -04:00
Russ Cox
03582b3308 http: delete error kludge
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
2011-08-23 22:39:25 -04:00
Paul Borman
af18e4b9b0 net: add ParseMAC function
ParseMAC parses a string representing MAC-48, EUI-48, or EUI-64 into
a HardwareAddr.

R=rsc, fshahriar
CC=golang-dev
https://golang.org/cl/4922048
2011-08-23 22:38:43 -04:00