Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3933)

Issue 155420044: code review 155420044: net/http: don't send implicit gzip Accept-Encoding on R... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 6 months ago by bradfitz
Modified:
9 years, 6 months ago
Reviewers:
gobot, adg
CC:
adg, golang-codereviews
Visibility:
Public.

Description

net/http: don't send implicit gzip Accept-Encoding on Range requests The http package by default adds "Accept-Encoding: gzip" to outgoing requests, unless it's a bad idea, or the user requested otherwise. Only when the http package adds its own implicit Accept-Encoding header does the http package also transparently un-gzip the response. If the user requested part of a document (e.g. bytes 40 to 50), it appears that Github/Varnish send: range(gzip(content), 40, 50) And not: gzip(range(content, 40, 50)) The RFC 2616 set of replacements (with the purpose of clarifying ambiguities since 1999) has an RFC about Range requests (http://tools.ietf.org/html/rfc7233) but does not mention the interaction with encodings. Regardless of whether range(gzip(content)) or gzip(range(content)) is correct, this change prevents the Go package from asking for gzip in requests if we're also asking for Range, avoiding the issue. If the user cared, they can do it themselves. But Go transparently un-gzipping a fragment of gzip is never useful. Fixes Issue 8923

Patch Set 1 #

Patch Set 2 : diff -r c4357074542926768bf0587b8f907aa177a964d7 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r c4357074542926768bf0587b8f907aa177a964d7 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 3266b7e742ba13bf2207d7e1447155653289629d https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -2 lines) Patch
M src/net/http/response_test.go View 1 1 chunk +28 lines, -0 lines 0 comments Download
M src/net/http/transport.go View 1 2 chunks +9 lines, -2 lines 0 comments Download
M src/net/http/transport_test.go View 1 1 chunk +33 lines, -0 lines 0 comments Download

Messages

Total messages: 5
bradfitz
Hello adg@golang.org (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
9 years, 6 months ago (2014-10-15 15:27:03 UTC) #1
adg
LGTM
9 years, 6 months ago (2014-10-15 15:37:59 UTC) #2
bradfitz
*** Submitted as https://code.google.com/p/go/source/detail?r=8ad75982389b *** net/http: don't send implicit gzip Accept-Encoding on Range requests The ...
9 years, 6 months ago (2014-10-15 15:51:17 UTC) #3
gobot
This changed caused perf changes on windows-amd64-perf: json-1 old new delta cputime 190000000 177187500 -6.74 ...
9 years, 6 months ago (2014-10-16 03:34:54 UTC) #4
bradfitz
9 years, 6 months ago (2014-10-16 08:45:39 UTC) #5
I really doubt it.  Can we disable these emails until they're accurate?


On Thu, Oct 16, 2014 at 5:34 AM, <gobot@golang.org> wrote:

> This changed caused perf changes on windows-amd64-perf:
>
>
> json-1                    old          new      delta
> cputime             190000000    177187500      -6.74
> time                190151452    177179758      -6.82
>
> json-2                    old          new      delta
> cputime             189375000    180156250      -4.87
> time                 95976543     90381493      -5.83
>
> json-4                    old          new      delta
> cputime             192343750    180859375      -5.97
> time                 48829030     46371814      -5.03
>
> json-8                    old          new      delta
> cputime             202593750    191906250      -5.28
> time                 26039480     24704277      -5.13
>
> http://build.golang.org/perfdetail?commit=8ad75982389b5c458a3c3c265568df
> 912fbcde4c&commit0=3266b7e742ba13bf2207d7e1447155653289629d&kind=builder&
> builder=windows-amd64-perf
>
>
>
> --gobot
>
>
> https://codereview.appspot.com/155420044/
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b