Goroutine 1:
Call Read on read half of pipe, entering pipeHalf.rw.
Check ioclosed field, which is false.
Send data to p.c1
Wait for response on p.c2.
Goroutine 2:
Call Close on read half of pipe, entering pipeHalf.close.
Set closed field.
Send error to p.cclose.
Set ioclosed field.
Send 1 to p.done.
Return and exit goroutine.
Goroutine 3:
This is the goroutine running pipe.run, and for some reason
it has started late.
Read error from p.rclose; set rerr and continue.
Read 1 from p.done; increment ndone and continue.
Read data from r1 (sent by goroutine 1); set r1 = nil and continue
Now goroutine 1 is waiting for a response, and goroutine 3 is
waiting for something else to happen.
This patch fixes the race by having the runner check whether
the read half is closed when it is asked for read data, and
similarly for the corresponding race on the write half.
This patch also fixes the similar race in which ndone gets
bumped up to 2 while there is a reader or writer waiting.
There is still another race to fix. It is possible for the
read half and the write half to both be closed, and for the
runner goroutine to exit, all before the runner goroutine sees
the request from a reader. E.g., in the above, have goroutine
2 also close the write half, and have goroutine 3 see both
done messages before it sees the request from goroutine 1.
R=rsc
CC=golang-dev
https://golang.org/cl/1862045
For the Windows version of syscall Errstr, set the
FORMAT_MESSAGE_IGNORE_INSERTS value of the FormatMessage
Flags argument when there are no values to insert.
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/1868043
SNI (Server Name Indication) is a way for a TLS client to
indicate to the server which name it knows the server by. This
allows the server to have several names and return the correct
certificate for each (virtual hosting).
PeerCertificates returns the list of certificates presented by
server.
R=r
CC=golang-dev
https://golang.org/cl/1741053
OCSP is the preferred X.509 revocation mechanism. X.509 certificates
can contain a URL from which can be fetched a signed response saying
"this certificate is valid until $x" (where $x is usually 7 days in the
future). These are called OCSP responses and they can also be included
in the TLS handshake itself ("OCSP stapling")
R=rsc, r
CC=golang-dev
https://golang.org/cl/1875043
- don't lose empty lines after labels
- canonicalize number of line breaks
- gofmt src misc, fixes a couple of irregular breaks
R=rsc
CC=golang-dev
https://golang.org/cl/1843044
but with less precision than hardware counterparts.
fixed a number of tests to output BUG when they failed.
changed the runner to distinghuish between output
and output containing ^BUG
R=rsc
CC=dho, golang-dev
https://golang.org/cl/1778041
strings.ToTitle converts all characters to title case, which for consistency with the
other To* functions it should continue to do. This CL adds string.Title, which
does a proper title-casing of the string.
A similar function for package bytes will follow once this is settled.
Fixes#933.
R=rsc
CC=golang-dev
https://golang.org/cl/1869042
Add support for ASN.1 ENUMERATED types.
Add a magic type, asn1.Flag, for the cases where the presence of an
empty explicit tag is semantically meaningful.
Add support for GeneralizedTime.
R=rsc
CC=golang-dev
https://golang.org/cl/1684055
out of floating constant multiply
2. added rounding code to "const fix=float"
to allow up to 29 (Mpscale) bits of
slop and still get an exact fixed constant.
fixes#931
R=rsc
CC=golang-dev
https://golang.org/cl/1692055
//line 10 units.y
which is equiv to c
#line 10 units.y
the purpose is to generate diagnostics
that correctly point to preprocessed source.
R=rsc
CC=golang-dev
https://golang.org/cl/1863042
Somewhat of a work-in-progress (in that MIME is a large spec), but this is
functional and enough for discussion and/or code review.
In addition to the unit tests, I've tested with curl and Chrome with
a variety of test files, making sure the digests of files are unaltered
when read via a multipart Part.
R=rsc, adg, dsymonds1, agl1
CC=golang-dev
https://golang.org/cl/1681049
* remember #defined names, so that C.stdout can refer
to the real name (on OS X) __stdoutp.
* better handling of #defined constant expressions
* allow n, err = C.strtol("asdf", 0, 123) to get errno as os.Error
* write all output files to current directory
* don't require gcc output if there was no input
Fixes#533.
Fixes#709.
Fixes#756.
R=r
CC=dho, golang-dev, iant
https://golang.org/cl/1734047
Also in this CL:
* Removed util.go, as its functionality is in big
* Removed some semicolons from the code generated by gen.go
* Added a generate target to Makefile
* Removed an outdated TODO from value.go
R=gri
CC=golang-dev
https://golang.org/cl/1780042
Use io/ioutil.TempFile with default os.TempDir for temporary test files.
For os_test.go temporary test files, use a local file system and OS
independent directory names. Avoid problems with NFS.
Fixes#848.
R=adg
CC=golang-dev
https://golang.org/cl/1806043
- sign to determine if a value is < 0, == 0, > 0
- abs to compute absolute value
- Rat.IsInt to test if a rational number is representable as an integer
R=rsc
CC=golang-dev
https://golang.org/cl/1761042
* Allow an exponent part. This is necessary for exp/eval.
* Fix a bug for input that had no numbers after the decimal.
* In Int.SetString, allow a leading + sign.
* In Int.SetString, error if the input is "-" with no number.
* In nat.scan, normalize the resulting nat.
R=gri
CC=golang-dev
https://golang.org/cl/1733045
updated thread.c to provide destroylock, which seems to be
required to link.
updated README with different virtualization programs.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/1746047
(Here, quoted strings are the official AMD names.)
The amd64 "movsxd" instruction, when invoked
with a 64-bit REX prefix, moves and sign extends
a 32-bit value from register or memory into a
64-bit register. 6.out.h spells this MOVLQSX.
6.out.h also includes MOVLQZX, the zero extending
version, which it implements as "movsxd" without
the REX prefix. Without the REX prefix it's only sign
extending 32 bits to 32 bits (i.e., not doing anything
to the bits) and then storing in a 32-bit register.
Any write to a 32-bit register zeros the top half of the
corresponding 64-bit register, giving the advertised effect.
This particular implementation of the functionality is
non-standard, because an ordinary 32-bit "mov" would
do the same thing.
Because it is non-standard, it is often mishandled or
not handled by binary translation tools like valgrind.
Switching to the standard "mov" makes the binaries
work better with those tools.
It's probably useful in 6c and 6g to have an explicit
instruction, though, so that the intent of the size
change is clear. Thus we leave the concept of MOVLQZX
and just implement it by the standard "mov" instead of
the non-standard 32-bit "movsxd".
Fixes#896.
R=ken2
CC=golang-dev
https://golang.org/cl/1733046
With these changes, goinstall is now able to use branches
maintained with Bazaar located in Launchpad.
Project aliases such as /project and /project/series are
supported in addition to specific user or team branches
such as /~user/project/branch. Temporary branches under
the +junk special project are also supported.
As a curious side effect, since Launchpad is able to import
code from other locations, they can be indirectly
accessible too if desired.
R=rsc
CC=golang-dev
https://golang.org/cl/1699050
The Makefile and cgo now rewrite / to _ when creating the path.
The .so for gosqlite.googlecode.com/hg/sqlite is named
cgo_gosqlite.googlecode.com_hg_sqlite.so, and then 6l and 8l
both include a default rpath of $GOROOT/pkg/$GOOS_$GOARCH.
This should make it easier to move binaries from one system
to another.
Fixes#857.
R=iant, r
CC=golang-dev
https://golang.org/cl/1700048
This is the Replace I suggested in the review of CL 1114041.
It's true that we already have
regexp.MustCompile(regexp.QuoteMeta(old)).ReplaceAll(s, new)
but because this Replace is doing a simpler job it is
simpler to call and inherently more efficient.
I will add the bytes implementation and tests to the
CL after the strings one has been reviewed.
R=r, cw
CC=golang-dev
https://golang.org/cl/1731048
For generating non-self-signed certs we need to be able to specify a
public key (for the signee) which is different from the private key (of
the signer).
R=rsc
CC=golang-dev
https://golang.org/cl/1741045
One goroutine started up and was waiting in rw. Then another
goroutine decided to close the pipe. The closing goroutine
stalled calling p.io.Lock() in pipeHalf.close. (This happened
in gccgo). If the closing goroutine had been able to set the
ioclosed flag, it would have gone on to tell the runner that
the pipe was closed, which would then send an EINVAL to the
goroutine sleeping in rw. Unlocking p.io before sleeping in
rw avoids the race.
R=rsc, rsc1
CC=golang-dev
https://golang.org/cl/1682048
Revision: 5885c9d10f created syscall_bsd.go for code used
by Darwin and other *BSDs, which should have included
FreeBSD. mksyscall.sh to generate new zsyscall_freebsd_386.go.
Fixes#862.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/1701048
Ping IDs should be limited to 16-bits. Fix failure printing.
R=rsc
CC=golang-dev, jean-christophe smith <jeanchristophe.smith
https://golang.org/cl/1682043
Currently to install a command, you have to manually
goinstall each of the remote packages that it depends on.
This patch lets goinstall P work where P is
contains files in package main.
It does not actually build the package, but
it installs all of its dependencies and prints a message
to that effect.
R=rsc
CC=golang-dev
https://golang.org/cl/1301043
x.go:13: cannot use t (type T) as type Reader in assignment:
T does not implement Reader (Read method requires pointer receiver)
x.go:19: cannot use q (type Q) as type Reader in assignment:
Q does not implement Reader (missing Read method)
have read()
want Read()
x.go:22: cannot use z (type int) as type Reader in assignment:
int does not implement Reader (missing Read method)
x.go:24: too many arguments to conversion to complex: complex(1, 3)
R=ken2
CC=golang-dev
https://golang.org/cl/1736041
This CL replaces my earlier https://golang.org/cl/1640044/show
in which Continue handling was explicit. Instead, this CL makes
it automatic. Reading from Body() is an implicit acknowledgement
that the request headers were fine and the body is wanted. In that
case, the 100 Continue response is written automatically when the
request continues the "Expect: 100-continue" header.
R=rsc, adg
CC=golang-dev
https://golang.org/cl/1610042
While we're at it, clean up and test the code to guarantee we see every byte when
the text is erroneous UTF-8.
Fixes#866.
R=rsc
CC=golang-dev
https://golang.org/cl/1712042
This shortens, simplifies and regularizes the code significantly.
(Improvements to reflect could make another step.)
Passes all.bash.
One semantic change occurs: The String() method changes
behavior. It used to run only for string formats such as %s and %q.
Instead, it now runs whenever the item has the method and the
result is then processed by the format as a string. Besides the
regularization, this has three effects:
1) width is honored for String() items
2) %x works for String() items
3) implementations of String that merely recur will recur forever
Regarding point 3, example from the updated documentation:
type X int
func (x X) String() string { return Sprintf("%d", x) }
should cast the value before recurring:
func (x X) String() string { return Sprintf("%d", int(x)) }
R=rsc
CC=golang-dev
https://golang.org/cl/1613045
Change TrimRight and TrimLeft to use these functions.
Incidentally fix minor bug in TrimRight.
Add some test cases for this.
YMMV whether it's worth saving the closure allocation.
R=r, r2
CC=golang-dev, hoisie, rsc
https://golang.org/cl/1198044