Skip to content

Commit 4969b46

Browse files
committed
doc/go1.7.html: update documentation regarding compress/flate
Document the following: * That the algorithmic changes are still compliant with RFC 1951. I remember people having questions regarding this issue, and it would be good to re-assure them that it is still standards compliant. * io.EOF can now be returned early (c27efce) * Use the term "decompress" when referred to as an action. The term "uncompressed" or "decompressed" are both valid as ways to represent the current state of the data. Change-Id: Ie29ebce709357359e7c36d3e7f3d53b260eaadfa Reviewed-on: https://go-review.googlesource.com/23552 Reviewed-by: Andrew Gerrand <[email protected]>
1 parent 2499683 commit 4969b46

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

doc/go1.7.html

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
493493
were asked for zero bytes with no data remaining, it would
494494
return a count of 0 and no error.
495495
Now it returns a count of 0 and the error
496-
<a href="/pkg/io/#EOF"><code>io.EOF</code></a> .
496+
<a href="/pkg/io/#EOF"><code>io.EOF</code></a>.
497497
</p>
498498

499499
<p>
@@ -532,6 +532,21 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
532532
but at the cost of producing compressed outputs that are 20-40% larger than those
533533
generated by the new <code>BestSpeed</code>.
534534
</p>
535+
536+
<p>
537+
It is important to note that both
538+
<code>BestSpeed</code> and <code>HuffmanOnly</code> produce a compressed output that is RFC 1951 compliant.
539+
In other words, any valid DEFLATE decompressor will continue to be able to decompress these outputs.
540+
</p>
541+
542+
<p>
543+
Lastly, there is a minor change to the decompressor's implementation of
544+
<a href="/pkg/io/#Reader"><code>io.Reader</code></a>. In previous versions,
545+
the decompressor deferred reporting
546+
<a href="/pkg/io/#EOF"><code>io.EOF</code></a> until exactly no more bytes could be read.
547+
Now, it reports
548+
<a href="/pkg/io/#EOF"><code>io.EOF</code></a> more eagerly when reading the last set of bytes.
549+
</p>
535550
</dd>
536551

537552
<dl id="crypto/tls"><a href="/pkg/crypto/tls/">crypto/tls</a></dl>
@@ -858,13 +873,13 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
858873
Since Go 1, the default behavior of the HTTP client is
859874
to request server-side compression
860875
using the <code>Accept-Encoding</code> request header
861-
and then to uncompress the response body transparently,
876+
and then to decompress the response body transparently,
862877
and this behavior is adjustable using the
863878
<a href="/pkg/net/http/#Transport"><code>Transport</code></a>'s <code>DisableCompression</code> field.
864879
In Go 1.7, to aid the implementation of HTTP proxies, the
865880
<a href="/pkg/net/http/#Response"><code>Response</code></a>'s new
866881
<code>Uncompressed</code> field reports whether
867-
this transparent uncompression took place.
882+
this transparent decompression took place.
868883
</p>
869884

870885
<p>
@@ -1090,7 +1105,7 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
10901105
were asked for zero bytes with no data remaining, it would
10911106
return a count of 0 and no error.
10921107
Now it returns a count of 0 and the error
1093-
<a href="/pkg/io/#EOF"><code>io.EOF</code></a> .
1108+
<a href="/pkg/io/#EOF"><code>io.EOF</code></a>.
10941109
</p>
10951110

10961111
<p>

0 commit comments

Comments
 (0)