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

19 Commits

Author SHA1 Message Date
Adam Langley
c12c5dba9c compress/bzip2: fix panics on malformed input.
Fixes 8363.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/114810043
2014-07-15 18:44:33 -07:00
Robert Hencke
f999e14f02 all: spelling tweaks, A-G
LGTM=ruiu, bradfitz
R=golang-codereviews, bradfitz, ruiu
CC=golang-codereviews
https://golang.org/cl/91840044
2014-04-29 12:44:40 -04:00
Adam Langley
9f0008bb93 compress/bzip2: support superfluous Huffman levels.
These should never be found in a bzip2 file but it does appear that
there's a buggy encoder that is producing them. Since the official
bzip2 handles this case, this change makes the Go code do likewise.

With this change, the code produces the same output as the official
bzip2 code on the invalid example given in the bug.

Fixes #7279.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/64010043
2014-02-14 17:17:19 -05:00
Brad Fitzpatrick
a18f4ab569 all: use {bytes,strings}.NewReader instead of bytes.Buffers
Use the smaller read-only bytes.NewReader/strings.NewReader instead
of a bytes.Buffer when possible.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/54660045
2014-01-27 11:05:01 -08:00
Russ Cox
8a0779f9b9 compress/bzip2: support concatenated files
While we're here, add a test for the same functionality in gzip,
which was already implemented, and add bzip2 CRC checks.

Fixes #5772.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12387044
2013-08-05 16:08:08 -04:00
Adam Langley
ce5d91baa5 compress/bzip2: don't panic on invalid input.
Fixes 5747.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/10401050
2013-06-24 10:59:41 -04:00
Rémy Oudompheng
394706b646 compress/bzip2: faster decoding.
benchmark                old ns/op    new ns/op    delta
BenchmarkDecodeDigits     19451173     14347829  -26.24%
BenchmarkDecodeTwain      57516800     42619978  -25.90%

benchmark                 old MB/s     new MB/s  speedup
BenchmarkDecodeDigits         2.22         3.01    1.36x
BenchmarkDecodeTwain          2.17         2.93    1.35x

R=golang-dev, dave, bradfitz, agl
CC=golang-dev
https://golang.org/cl/9915043
2013-06-03 20:38:00 +02:00
Brad Fitzpatrick
e15c0ac693 all: remove now-unnecessary unreachable panics
Take advantage of the new terminating statement rule.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/7712044
2013-03-11 14:16:55 -07:00
Robert Griesemer
465b9c35e5 gofmt: apply gofmt -w src misc
Remove trailing whitespace in comments.
No other changes.

R=r
CC=golang-dev
https://golang.org/cl/6815053
2012-10-30 13:38:01 -07:00
Anthony Martin
422da762b7 compress/bzip2: use io.ByteReader instead of internal interface
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6663044
2012-10-12 14:09:24 -07:00
Russ Cox
2050a9e478 build: remove Make.pkg, Make.tool
Consequently, remove many package Makefiles,
and shorten the few that remain.

gomake becomes 'go tool make'.

Turn off test phases of run.bash that do not work,
flagged with $BROKEN.  Future CLs will restore these,
but this seemed like a big enough CL already.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
2012-01-30 23:43:46 -05:00
Rob Pike
0a5508c692 various: we don't cast, we convert
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5437142
2011-12-05 19:40:52 -08:00
Gustavo Niemeyer
f2dc50b48d html,bzip2,sql: rename Error methods that return error to Err
There are three classes of methods/functions called Error:

a) The Error method in the just introduced error interface
b) Error methods that create or report errors (http.Error, etc)
c) Error methods that return errors previously associated with
   the receiver (Tokenizer.Error, rows.Error, etc).

This CL introduces the convention that methods in case (c)
should be named Err.

The reasoning for the change is:

- The change differentiates the two kinds of APIs based on
  names rather than just on signature, unloading Error a bit
- Err is closer to the err variable name that is so commonly
  used with the intent of verifying an error
- Err is shorter and thus more convenient to be used often
  on error verifications, such as in iterators following the
  convention of the sql package.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5327064
2011-11-04 09:50:20 -04:00
Russ Cox
492098eb75 all: rename os.Error to error in various non-code contexts
R=adg
CC=golang-dev
https://golang.org/cl/5328062
2011-11-01 22:58:09 -04:00
Russ Cox
c2049d2dfe src/pkg/[a-m]*: gofix -r error -force=error
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5322051
2011-11-01 22:04:37 -04:00
Robert Hencke
c8727c81bb pkg: spelling tweaks, A-H
R=ality, bradfitz, rsc, dsymonds, adg, qyzhai, dchest
CC=golang-dev
https://golang.org/cl/4536063
2011-05-18 13:14:56 -04:00
Adam Langley
e7fa307902 bzip2: speed up decompression.
This borrows a trick from the bzip2 source and effects a decent speed
up when decompressing highly compressed sources. Rather than unshuffle
the BTW block when performing the IBTW, a linked-list is threaded
through the array, in place. This improves cache hit rates.

R=bradfitzgo, bradfitzwork, cw
CC=golang-dev
https://golang.org/cl/4247047
2011-03-03 09:13:06 -05:00
Adam Langley
da8e6eec9a compress/bzip2: fix bugs
(Once again, proving that a fuzz tester is the first thing that I
should try.)

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4227042
2011-02-23 12:02:41 -05:00
Adam Langley
bf6939829d compress/bzip2: add package.
This code implements bzip2 decompression only.

R=bradfitzgo, r2, nigeltao, rsc
CC=golang-dev
https://golang.org/cl/4176051
2011-02-23 10:23:28 -05:00