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

216 Commits

Author SHA1 Message Date
Russ Cox
2f06615588 encoding/asn1: prepare for 64-bit ints
The code was assuming that int = 32 bits. Don't.

Update #2188.

R=agl
CC=golang-dev
https://golang.org/cl/6543063
2012-09-24 10:30:37 -04:00
Robert Griesemer
93195e1f31 encoding/gob: fix comment
Fixes #4100.

R=adg, r, dave
CC=golang-dev
https://golang.org/cl/6535055
2012-09-19 10:11:24 -07:00
Russ Cox
ccf2b8843e encoding/json: do not read beyond array literal
Fixes #3942.

R=golang-dev, mike.rosset, r
CC=golang-dev
https://golang.org/cl/6524043
2012-09-18 14:22:55 -04:00
Russ Cox
f97bfb93f4 encoding/json: handle anonymous fields
Fixes #3069.

R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/6460044
2012-09-10 23:31:40 -04:00
Shawn Smith
a11b748fa2 encoding/xml: parse comments in DOCTYPE
R=rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/6330061
2012-08-31 18:09:31 -04:00
David Symonds
3e980e24c1 encoding/gob: test for type registration name.
R=r
CC=golang-dev
https://golang.org/cl/6435044
2012-07-25 09:31:27 +10:00
Rob Pike
7b73251d3d encoding/gob: revert 6348067, which broke compatibility
Add commentary to explain better what's going on, but the
code change is a simple one-line reversal to the previous
form.

R=rsc
CC=golang-dev
https://golang.org/cl/6428072
2012-07-23 13:34:46 -07:00
Patrick Mylund Nielsen
614cb3b8dd encoding/binary: fix typo: ReadVarint returns an int64, not a uint64.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6432062
2012-07-22 10:26:32 +10:00
Rob Pike
bbe601789c encoding/gob: disable fuzz tests unless command-line flag is set
They can generate huge amounts of memory, causing failure on
small machines. Also they can be very slow. So slow that one test
was commented out! We uncomment it and use a flag.

Fixes #3742.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6373044
2012-07-13 14:23:51 -07:00
Rob Pike
37519d950d encoding/gob: reduce decoder memory
Gob decoding reads a whole message into memory and then
copies it into a bytes.Buffer. For large messages this wastes
an entire copy of the message. In this CL, we use a staging
buffer to avoid the large temporary.

Update #2539
RSS drops to 775MB from 1GB.
Active memory drops to 858317048 from 1027878136,
essentially the size of one copy of the input file.

R=dsymonds, nigeltao
CC=golang-dev
https://golang.org/cl/6392057
2012-07-12 20:53:17 -07:00
Rob Pike
1fa32d21a9 encoding/gob: fix check for short input in slice decode
R=golang-dev, dsymonds, r, nigeltao
CC=golang-dev
https://golang.org/cl/6374059
2012-07-12 10:23:54 -07:00
Adam Langley
eeffa738a9 encoding/asn1: promote untyped strings to UTF8 as needed.
Previously, strings that didn't have an explicit ASN.1 string type
were taken to be ASN.1 PrintableStrings. This resulted in an error if
a unrepresentable charactor was included.

For compatibility reasons, I'm too afraid to switch the default string
type to UTF8String, but this patch causes untyped strings to become
UTF8Strings if they contain a charactor that's not valid in a
PrintableString.

Fixes #3791.

R=golang-dev, bradfitz, r, r
CC=golang-dev
https://golang.org/cl/6348074
2012-07-10 18:23:30 -04:00
Rob Pike
b04bf3882b encoding/gob: fix bug in Register
The old code added a star but did not indirect the reflect.Type.

R=bradfitz
CC=golang-dev
https://golang.org/cl/6348067
2012-07-03 10:05:27 -07:00
Jonathan Gold
b7bb1e32d8 encoding/json: add Number type
Number represents the actual JSON text,
preserving the precision and
formatting of the original input.

R=rsc, iant
CC=golang-dev
https://golang.org/cl/6202068
2012-06-25 17:36:09 -04:00
Thomas Alan Copeland
c08ff027c4 encoding/base32, encoding/base64: removed unneeded break label
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6305086
2012-06-25 17:18:50 -04:00
Micah Stetson
51ff2ef409 encoding/json: simplify (*decodeState).indirect
Removes an incorrect code comment and some superfluous variables.

The comment I removed says that struct fields which implement
Unmarshaler must be pointers, even if they're in an addressable
struct. That's not the case, and there's already a test in decode_test.go
that demonstrates as much.

Encoding/json has quite a few assignments of reflect.Values to extra
variables – things like "iv := v" when there's no need to make a copy. I
think these are left over from a previous version of the reflect API. If they
aren't wanted, I wouldn't mind going through the package and getting
rid of the rest of them.

R=rsc
CC=golang-dev
https://golang.org/cl/6318047
2012-06-25 16:03:18 -04:00
Jan Ziak
32a0cbb881 encoding/csv, encoding/xml: report write errors
Fixes #3773.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6327053
2012-06-25 16:00:35 -04:00
David G. Andersen
75344d3d5b encoding/json: fix minor typo in documentation for Marshal
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6325053
2012-06-22 14:43:41 -07:00
Rob Pike
733ee91786 encoding/gob: don't cache broken encoding engines.
Fixes a situation where a nested bad type would still
permit the outer type to install a working engine, leading
to inconsistent behavior.

Fixes #3273.

R=bsiegert, rsc
CC=golang-dev
https://golang.org/cl/6294067
2012-06-13 15:55:43 -07:00
Rob Pike
ea3c3bb3a8 encoding/gob: better handling of nil pointers
- better message for top-level nil
- nil inside interface yields error, not panic

Fixes #3704.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6304064
2012-06-12 00:36:39 -04:00
Brad Fitzpatrick
1d609f9b9f encoding/gob: fix doc typo
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6300078
2012-06-09 18:30:44 -07:00
Russ Cox
09b736a2ab encoding/json: fix panic unmarshaling into non-nil interface value
Fixes #3614.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6306051
2012-06-07 01:48:55 -04:00
Russ Cox
d61707f490 encoding/json: add round trip test in Unmarshal
Also convert table to use tagged literal.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6258061
2012-05-29 18:02:40 -04:00
Brad Fitzpatrick
83771afe10 encoding/json: documentation fix
Fixes #3650

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6238046
2012-05-23 17:18:05 -07:00
Gustavo Niemeyer
fdc45367f9 encoding/xml: fix decoding of unknown entities in non-strict mode
Fixes #3447.

R=rsc, gustavo
CC=golang-dev
https://golang.org/cl/6039045
2012-05-17 00:04:00 -03:00
Gustavo Niemeyer
9242a90ab5 encoding/xml: handle anonymous pointer fields
This CL makes

    type T struct { *U }

behave in a similar way to:

    type T struct { U }

Fixes #3108.

R=golang-dev, rsc, gustavo
CC=golang-dev
https://golang.org/cl/5694044
2012-05-16 23:21:31 -03:00
Michael Chaten
3fab2a97e4 encoding/json: Fix panic when trying to unmarshal the empty string into an integer
Fixes #3450.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6035050
2012-05-03 17:35:44 -04:00
David Symonds
c3c8e35af2 encoding/json: don't match field name if a JSON struct tag is present.
Fixes #3566.

R=rsc
CC=golang-dev
https://golang.org/cl/6139048
2012-05-01 11:37:44 +10:00
Brad Fitzpatrick
ed90fbc747 encoding/base64: don't ignore underlying souce read error in decode
Fixes #3577

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6137054
2012-04-30 17:14:41 +10:00
Bobby Powers
52f122d72e encoding/json: allow punctuation in tag names
everything except backslash and the quote chars is fair game.

Fixes #3546.

R=rsc, r
CC=golang-dev
https://golang.org/cl/6048047
2012-04-25 14:33:33 +10:00
Adam Langley
6742d0a085 encoding/asn1: allow lengths up to the maximum int value.
Previously we capped lengths at 2**24 rather than 2**31.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/6050050
2012-04-18 13:41:11 -04:00
Adam Langley
55af51d5c0 encoding/pem: ignore spaces and tabs at the end of header lines.
Fixes #3502.

R=bradfitz
CC=golang-dev
https://golang.org/cl/6011046
2012-04-12 12:33:52 -04:00
Dmitry Chestnykh
ac51c1384a encoding/ascii85: fix panic caused by special case
Special case for encoding 4 zeros as 'z' didn't
update source slice, causing 'index out of bounds'
panic in destination slice.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5970078
2012-04-04 09:52:42 -04:00
Dave Cheney
951a97e42f encoding/base64: fix panic when input len is not a multiple of 4
Fixes #3442.

R=for.go.yong, dsymonds, sougou, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/5975052
2012-04-03 12:14:02 +10:00
Francisco Souza
289a357104 doc: add JSON and Go article
Originally published on The Go Programming Language Blog, January 25, 2011.

http://blog.golang.org/2011/01/json-and-go.html

R=adg
CC=golang-dev
https://golang.org/cl/5846044
2012-03-22 18:25:40 +11:00
Francisco Souza
9e03dcb3fa doc: add Gobs of data article
Originally published on The Go Programming Language Blog, March 24, 2011.

http://blog.golang.org/2011/03/gobs-of-data.html

R=adg
CC=golang-dev
https://golang.org/cl/5834043
2012-03-16 08:21:13 +11:00
Robert Griesemer
56cae1c230 all: gofmt -w -s src misc
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5781058
2012-03-08 10:48:51 -08:00
Dmitriy Vyukov
c8b1f85493 encoding/gob: fix memory corruption
Fixes #3175.

R=golang-dev, iant, rsc, r
CC=golang-dev
https://golang.org/cl/5758069
2012-03-08 08:53:08 +11:00
Paul Borman
1b311776c4 csv: clarify what a negative FieldsPerRecord means
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5729068
2012-03-05 13:34:12 -05:00
Russ Cox
8dbd9d746d encoding/json: document that nil slice encodes as null
Fixes #3189.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5730058
2012-03-05 13:29:22 -05:00
Adam Langley
52d6ca2f86 crypto/x509: don't include empty additional primes in PKCS#1 private key.
asn1 didn't have an omitempty tag, so the list of additional primes in
an RSA private key was serialised as an empty SEQUENCE, even for
version 1 structures. This tripped up external code that didn't handle
v2.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5729062
2012-03-05 12:04:18 -05:00
Adam Langley
6aed613030 encoding/asn1: handle UTCTime before the year 2000
UTCTime only has a two digit date field and year values from 50 should
be 1950, not 2050.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5729063
2012-03-05 11:31:24 -05:00
Stefan Nilsson
a347fdb035 encoding/binary: improve package comment.
The current package comment doesn't mention varints and
protocol buffers. Also, the first sentence is incomprehensible
without further context as "fixed-size values" is undefined.

R=rsc
CC=golang-dev
https://golang.org/cl/5715048
2012-03-05 10:02:30 -05:00
Gustavo Niemeyer
b5d4cffd15 encoding/xml: fix xml test tag usage
No real problem.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5717049
2012-03-01 15:20:13 -03:00
David Symonds
99e45e49b7 encoding/json: escape output from Marshalers.
Fixes #3127.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5707054
2012-03-01 17:41:59 +11:00
David Symonds
1f0f459a16 encoding/gob: more hardening for lengths of input strings.
Fixes #3160.

R=r
CC=golang-dev
https://golang.org/cl/5716046
2012-03-01 15:57:54 +11:00
Robert Hencke
fc79058199 gob: trivial print fix
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5707062
2012-02-29 08:45:57 -08:00
Rémy Oudompheng
c10f50859e all: remove various unused unexported functions and constants.
R=golang-dev, minux.ma, rsc
CC=golang-dev, remy
https://golang.org/cl/5702050
2012-02-28 21:48:03 +01:00
Shenghou Ma
e0aa36147d encoding/gob: fix "// +build" comment for debug.go
R=golang-dev, rsc, adg, r, r
CC=golang-dev
https://golang.org/cl/5693060
2012-02-28 13:39:42 +08:00
David Symonds
9dd746c4cb encoding/json: drop MarshalForHTML; gofix calls to Marshal.
I've elected to omit escaping the output of Marshalers for now.
I haven't thought through the implications of that;
I suspect that double escaping might be the undoing of that idea.

Fixes #3127.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5694098
2012-02-28 11:41:16 +11:00