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

Issue 6238043: code review 6238043: net/http: make client await response concurrently with ... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by bradfitz
Modified:
11 years, 10 months ago
Reviewers:
CC:
rsc, adg, golang-dev
Visibility:
Public.

Description

net/http: make client await response concurrently with writing request If the server replies with an HTTP response before we're done writing our body (for instance "401 Unauthorized" response), we were previously ignoring that, since we returned our write error ("broken pipe", etc) before ever reading the response. Now we read and write at the same time. Fixes issue 3595

Patch Set 1 #

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

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

Patch Set 4 : diff -r 0a76445053e5 https://go.googlecode.com/hg/ #

Total comments: 3

Patch Set 5 : diff -r cd427be02cb1 https://go.googlecode.com/hg #

Total comments: 5

Patch Set 6 : diff -r f7839a55036e https://go.googlecode.com/hg #

Patch Set 7 : diff -r f7839a55036e https://go.googlecode.com/hg #

Patch Set 8 : diff -r f7839a55036e https://go.googlecode.com/hg #

Patch Set 9 : diff -r f7839a55036e https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -10 lines) Patch
M src/pkg/net/http/transport.go View 1 2 3 4 5 6 7 9 chunks +62 lines, -10 lines 0 comments Download
M src/pkg/net/http/transport_test.go View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 19
bradfitz
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg
11 years, 11 months ago (2012-05-23 22:56:19 UTC) #1
bradfitz
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 11 months ago (2012-05-24 00:01:29 UTC) #2
bradfitz
PTAL (or a first look) This CL now works, and is now updated with the ...
11 years, 11 months ago (2012-05-24 00:02:44 UTC) #3
rsc
I'm sad about how crufty the http code is getting. I realize that dealing with ...
11 years, 11 months ago (2012-05-29 17:05:50 UTC) #4
bradfitz
Any alternative proposals? On Tue, May 29, 2012 at 10:05 AM, <rsc@golang.org> wrote: > I'm ...
11 years, 11 months ago (2012-05-29 17:11:13 UTC) #5
rsc
On Tue, May 29, 2012 at 1:11 PM, Brad Fitzpatrick <bradfitz@golang.org> wrote: > Any alternative ...
11 years, 11 months ago (2012-05-29 17:13:12 UTC) #6
rsc
On Tue, May 29, 2012 at 1:12 PM, Russ Cox <rsc@golang.org> wrote: > Does this ...
11 years, 11 months ago (2012-05-29 17:17:01 UTC) #7
bradfitz
On Tue, May 29, 2012 at 10:16 AM, Russ Cox <rsc@golang.org> wrote: > On Tue, ...
11 years, 11 months ago (2012-05-29 17:28:03 UTC) #8
rsc
Sure, splitting them sounds good.
11 years, 11 months ago (2012-05-29 17:31:05 UTC) #9
bradfitz
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 11 months ago (2012-05-29 21:48:55 UTC) #10
bradfitz
ping
11 years, 11 months ago (2012-06-03 23:37:59 UTC) #11
adg
LGTM http://codereview.appspot.com/6238043/diff/6005/src/pkg/net/http/transport.go File src/pkg/net/http/transport.go (right): http://codereview.appspot.com/6238043/diff/6005/src/pkg/net/http/transport.go#newcode625 src/pkg/net/http/transport.go:625: wr.ch <- errors.New("http: can't write HTTP request on ...
11 years, 10 months ago (2012-06-18 15:39:42 UTC) #12
rsc
I'm not sure I really understand what's going on here anymore. http://codereview.appspot.com/6238043/diff/6005/src/pkg/net/http/transport.go File src/pkg/net/http/transport.go (right): ...
11 years, 10 months ago (2012-06-19 04:13:38 UTC) #13
adg
http://codereview.appspot.com/6238043/diff/6005/src/pkg/net/http/transport.go File src/pkg/net/http/transport.go (right): http://codereview.appspot.com/6238043/diff/6005/src/pkg/net/http/transport.go#newcode642 src/pkg/net/http/transport.go:642: func (re responseAndError) ok() bool { return re.res != ...
11 years, 10 months ago (2012-06-19 04:38:40 UTC) #14
rsc
LGTM I understand this better on a big screen. :-) http://codereview.appspot.com/6238043/diff/6005/src/pkg/net/http/transport.go File src/pkg/net/http/transport.go (right): http://codereview.appspot.com/6238043/diff/6005/src/pkg/net/http/transport.go#newcode642 ...
11 years, 10 months ago (2012-06-19 16:02:44 UTC) #15
bradfitz
http://codereview.appspot.com/6238043/diff/6005/src/pkg/net/http/transport.go File src/pkg/net/http/transport.go (right): http://codereview.appspot.com/6238043/diff/6005/src/pkg/net/http/transport.go#newcode642 src/pkg/net/http/transport.go:642: func (re responseAndError) ok() bool { return re.res != ...
11 years, 10 months ago (2012-06-19 16:04:50 UTC) #16
bradfitz
Hello rsc@golang.org, adg@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 10 months ago (2012-06-19 16:14:22 UTC) #17
bradfitz
Hello rsc@golang.org, adg@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 10 months ago (2012-06-19 16:16:50 UTC) #18
bradfitz
11 years, 10 months ago (2012-06-19 16:20:46 UTC) #19
*** Submitted as http://code.google.com/p/go/source/detail?r=305f67dc3f99 ***

net/http: make client await response concurrently with writing request

If the server replies with an HTTP response before we're done
writing our body (for instance "401 Unauthorized" response), we
were previously ignoring that, since we returned our write
error ("broken pipe", etc) before ever reading the response.
Now we read and write at the same time.

Fixes issue 3595

R=rsc, adg
CC=golang-dev
http://codereview.appspot.com/6238043
Sign in to reply to this message.

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