Permits serving from virtual filesystems, such as files linked
into a binary, or from a zip file.
Also adds a gofix for:
http.FileServer(root, prefix) -> http.StripPrefix(prefix, http.FileServer(http.Dir(root)))
R=r, rsc, gri, adg, dsymonds, r, gri
CC=golang-dev
https://golang.org/cl/4629047
Reader previously had cached an error from the underlying reader
and would return it on every subsequent call to Read. The Reader
will now return the error only once, and subsequent calls will result
in a new Read call to the underlying Reader.
Fixes#1934.
R=bradfitz, rogpeppe, rsc
CC=golang-dev
https://golang.org/cl/4528133
8a/a.h:
. Removed <u.h> and <libc.h> includes as they work better in "a.y".
. Made definition of EOF conditional as it's defined in the Plan 9
header files, but not elsewhere.
8a/a.y:
. Added <u.h> and <libc.h> because <stdio.h> in Plan 9 needs them.
Sequence <u.h>, <stdio.h>, <libc.h> recommended by RSC.
8a/lex.c:
. Added <u.h> and <libc.h> as now needed by "a.h".
. Dropped <ctype.h>.
cc/lexbody:
. exit() -> exits().
. Dropped unwanted incrementation.
cc/macbody:
. Adjusted a few format specifications.
R=rsc
CC=golang-dev
https://golang.org/cl/4644047
Previously we were snapshotting the TLS state into *Request
before we did the HTTP ReadRequest, the first Read of which
triggered the TLS handshake implicitly.
Fixes#1956
R=golang-dev, rsc
CC=agl, golang-dev
https://golang.org/cl/4630072
-test.benchtime allows to specify benchmark execution time.
-test.cpu allows to execute tests/benchmarks for several
values of GOMAXPROCS.
R=r, r, rsc
CC=golang-dev
https://golang.org/cl/4662046
did darwin on mac with older, not broken xcode.
did linux arm by copying diffs from linux 386.
did freebsd amd64 by copying diffs from freebsd 386.
R=golang-dev, r, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/4629067
Documentation mentioned the obsolete package "crypto/block",
which has been replaced with "crypto/cipher".
R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/4654064
- don't rely on /dev/stdin as the name for standard input
- employ EBNF extraction if the source contains tags
"cat source.html | ebnflint" works now
R=r
CC=golang-dev
https://golang.org/cl/4641075
Users of the Scan() infrastructure that employ ReadRune() rather than
Token() need a way to skip leading spaces and newlines as set by the
the parent, Fscan(), Fscanln, or Fscanf(). As the internal methods and
boolean flags are not exported, this new function was added here and
in the Int and Nat Scan() functions of the big package. (fmt.Rat did
not need change since it uses Token()) Also added Printf style format
code support to int types and tests for same to int_test.go
R=r, r, gri, mtj
CC=golang-dev
https://golang.org/cl/4634074
As rsc suggested after change 58a6bdac3d12 was committed, we
now read the first byte of Request.Body when the
Request.ContentLength is 0 to disambiguate between a truly
zero-length body and a body of unknown length where the user
didn't set the ContentLength field.
This was also causing the reverse proxy problem where incoming
requests (which always have a body, of private type http.body,
even for 0-lengthed requests) were being relayed to the http
Transport for fetching, which was serializing the request as a
chunked request (since ContentLength was 0 and Body was
non-nil)
Fixes#1999
R=golang-dev, kevlar
CC=golang-dev
https://golang.org/cl/4628063
RFC 1521 section 4 states "The type, subtype, and parameter names are not case sensitive.".
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4648047
grsec needs the FIXED flag to be provided to mmap, which
works now. That said, when the allocation fails to be made
in the specific address, we're still given back a writable
page. This change will unmap that page to avoid using
twice the amount of memory needed.
It'd also be pretty easy to avoid the extra system calls
once we detected that the flag is needed, but I'm not sure
if that edge case is worth the effort.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4634086
The optable for 0xDB is handled specially.
This was the cause of a really weird bug
when using cov (386!) on the math package.
A real head-scratcher.
R=rsc
CC=golang-dev
https://golang.org/cl/4639066
This has the effect of making goinstall rebuild a package's
dependencies when they are newer than the current package object.
R=rsc
CC=golang-dev
https://golang.org/cl/4627051
These changes add a Ctty int field to the Unix syscall.ProcAttr which,
if set >= 0 in conjuction with Setsid=true, will be used by
forkAndExecInChild as the file descriptor for the new child's
controlling terminal.
Necessary changes have been made to mkerrors.sh to generate defs for
TIOC*, though changes to its output files are not included here.
The changes made should support Linux, FreeBSD and Darwin, at least.
R=iant, bradfitz, r, rsc, borman
CC=golang-dev
https://golang.org/cl/4532075
This prevents ld from generating zeroed symtab entries for
sections that aren't going to be generated because dynamic
linkage has been disabled (-d was used or no dynamic libs
were seen). Even though they were not explicitly added by
doelf, the section creation process was making them
reachable again.
The windows head is being disconsidered for this because
apparently it's not taking into account debug['d'].
This makes elflint 0.1% happier.
R=golang-dev, rsc, gustavo
CC=golang-dev
https://golang.org/cl/4638050
This is a core API change.
1) gofix misc src
2) Manual adjustments to the following files under src/pkg:
gob/decode.go
rpc/client.go
os/error.go
io/io.go
bufio/bufio.go
http/request.go
websocket/client.go
as well as:
src/cmd/gofix/testdata/*.go.in (reverted)
test/fixedbugs/bug243.go
3) Implemented gofix patch (oserrorstring.go) and test case (oserrorstring_test.go)
Compiles and runs all tests.
R=r, rsc, gri
CC=golang-dev
https://golang.org/cl/4607052
The test is only defined on darwin/amd64, and it fails
with recent versions of Xcode, which do not support
-gstabs+ debugging output. At some point godefs will
have to be replaced, perhaps merged with cgo.
Godefs is not needed during builds anyway (its output files
are checked into the repository in src/pkg/runtime),
so its failure on the newer Xcode is a distraction from an
otherwise usable build. Disable the test.
Fixes#1985.
R=golang-dev, gri, robert.hencke, r
CC=golang-dev
https://golang.org/cl/4638053