Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Issue 1755005: SPDY: Fix Alternate-Protocol. (Closed)

Created:
10 years, 8 months ago by willchan no longer on Chromium
Modified:
9 years, 7 months ago
Reviewers:
Mike Belshe, eroman, wtc
CC:
chromium-reviews
Visibility:
Public.

Description

SPDY: Fix Alternate-Protocol. (1) In DoInitConnection() we do the existing spdy session check. If it exists there, then we assuem it exists in DoSpdySendRequest(). Unfortunately, we didn't do the same check. Use a member variable to store the HostPortPair. (2) In DoInitConnection(), we used the scheme://urlhost:urlport as the connection group. With Alternate-Protocol, we used the scheme://urlhost:urlport even though we were connecting to a different port, with a different protocol (TLS). This means we would mix conflicting sockets in the ClientSocketPool. I fix this by dropping scheme://, since it's unnecessary, and would cause us not to share SSL sockets in different connection groups (since the specified scheme might be http://, but due to Alternate-Protocol, we actually do an SSL connect). I also don't use the urlhost:urlport, but use the host:port that we actually connect to. TODO(willchan): Fix Alternate-Protocol so it works properly with proxies. I need to change CONNECT for http proxies and patch the SOCKs connects. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=45627

Patch Set 1 #

Total comments: 6

Patch Set 2 : Add tests, add fixes. #

Patch Set 3 : Handle IPv6 addresses. #

Patch Set 4 : Get rid of unnecessary braces. #

Total comments: 14

Patch Set 5 : Address wtc's comments. #

Patch Set 6 : Merge. #

Patch Set 7 : Fix merge. #

Patch Set 8 : Address mbelshe's comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+495 lines, -212 lines) Patch
M net/base/host_port_pair.h View 3 4 2 chunks +7 lines, -3 lines 0 comments Download
M net/base/host_port_pair.cc View 1 2 3 4 5 6 7 1 chunk +8 lines, -1 line 0 comments Download
M net/http/http_network_transaction.h View 1 chunk +6 lines, -0 lines 0 comments Download
M net/http/http_network_transaction.cc View 1 2 3 4 5 4 chunks +27 lines, -23 lines 0 comments Download
M net/http/http_network_transaction_unittest.cc View 2 8 chunks +225 lines, -6 lines 0 comments Download
M net/net.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M net/socket/socket_test_util.h View 2 3 4 5 6 3 chunks +48 lines, -3 lines 0 comments Download
M net/socket/socket_test_util.cc View 2 3 4 5 6 3 chunks +55 lines, -4 lines 0 comments Download
M net/spdy/spdy_framer.h View 3 chunks +2 lines, -1 line 0 comments Download
M net/spdy/spdy_network_transaction_unittest.cc View 2 3 4 5 6 7 3 chunks +1 line, -171 lines 0 comments Download
A net/spdy/spdy_test_util.h View 2 3 4 5 6 7 1 chunk +115 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
wtc
http://codereview.chromium.org/1755005/diff/1/2 File net/base/host_port_pair.cc (right): http://codereview.chromium.org/1755005/diff/1/2#newcode11 net/base/host_port_pair.cc:11: return StringPrintf("%s:%u", host.c_str(), port); Please make sure if |host| ...
10 years, 8 months ago (2010-04-22 00:42:34 UTC) #1
willchan no longer on Chromium
http://codereview.chromium.org/1755005/diff/1/3 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/1755005/diff/1/3#newcode763 net/http/http_network_transaction.cc:763: connection_group.append(peer_.ToString()); On 2010/04/22 00:42:34, wtc wrote: > This change ...
10 years, 8 months ago (2010-04-22 01:05:21 UTC) #2
Mike Belshe
lgtm http://codereview.chromium.org/1755005/diff/1/3 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/1755005/diff/1/3#newcode897 net/http/http_network_transaction.cc:897: CHECK(connection_->socket()); nit: I would make this a DCHECK. ...
10 years, 8 months ago (2010-04-22 02:26:27 UTC) #3
willchan no longer on Chromium
I've updated the changelist. I also noted in the changelist description that I have to ...
10 years, 8 months ago (2010-04-22 23:47:47 UTC) #4
Mike Belshe
lgtm http://codereview.chromium.org/1755005/diff/11001/12001 File net/base/host_port_pair.cc (right): http://codereview.chromium.org/1755005/diff/11001/12001#newcode15 net/base/host_port_pair.cc:15: if (host.find(':') != std::string::npos) nit: I'd put a ...
10 years, 8 months ago (2010-04-23 21:56:12 UTC) #5
wtc
I only reviewed your changes to host_port_pair.* and http_network_transaction.*. They look good to me. I ...
10 years, 8 months ago (2010-04-23 22:53:48 UTC) #6
willchan no longer on Chromium
http://codereview.chromium.org/1755005/diff/11001/12002 File net/base/host_port_pair.h (right): http://codereview.chromium.org/1755005/diff/11001/12002#newcode31 net/base/host_port_pair.h:31: std::string ToStringNoBrackets() const; On 2010/04/23 22:53:48, wtc wrote: > ...
10 years, 8 months ago (2010-04-23 23:30:58 UTC) #7
willchan no longer on Chromium
Updated, merged, and fixed Mike's comments too. I'm going to land this today unless anyone ...
10 years, 8 months ago (2010-04-26 20:55:05 UTC) #8
wtc
Will, thanks for your reply. http://codereview.chromium.org/1755005/diff/11001/12003 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/1755005/diff/11001/12003#newcode762 net/http/http_network_transaction.cc:762: if (proxy_mode_ == kDirectConnection) ...
10 years, 8 months ago (2010-04-27 00:00:10 UTC) #9
willchan no longer on Chromium
http://codereview.chromium.org/1755005/diff/11001/12003 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/1755005/diff/11001/12003#newcode762 net/http/http_network_transaction.cc:762: if (proxy_mode_ == kDirectConnection) On 2010/04/27 00:00:10, wtc wrote: ...
10 years, 8 months ago (2010-04-27 00:21:24 UTC) #10
wtc
http://codereview.chromium.org/1755005/diff/11001/12003 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/1755005/diff/11001/12003#newcode762 net/http/http_network_transaction.cc:762: if (proxy_mode_ == kDirectConnection) Will: you did the right ...
10 years, 8 months ago (2010-04-27 17:18:43 UTC) #11
willchan no longer on Chromium
10 years, 8 months ago (2010-04-27 17:27:08 UTC) #12
http://codereview.chromium.org/1755005/diff/11001/12003
File net/http/http_network_transaction.cc (right):

http://codereview.chromium.org/1755005/diff/11001/12003#newcode762
net/http/http_network_transaction.cc:762: if (proxy_mode_ == kDirectConnection)
On 2010/04/27 17:18:43, wtc wrote:
> Will: you did the right thing to not wait for my comment.
> This is a minor issue.  I just wanted to make sure I understood
> the code.
> 
> I think the DoInitConnection function has grown too long.
> I'm considering turning the middle section of the function
> into a ComputeConnectionInfo function.  If you agree, I'll
> create a changelist.

I agree with this.  I was actually going to wait for jar to do this, because he
needs to compute this for his TCP prewarming change.  It sounds to me that
perhaps it needs to be extracted to be a free / class static function.  I think
that we should perhaps put it in client_socket_pool.h or somewhere, since Jim's
code theoretically doesn't need to depend on http_network_transaction.h.

I was actually thinking that in the future, the connection groups could be
HostPortPairs instead of strings, but that doesn't work right now because of how
our proxy connection groups work.  I was thinking of fixing
http://code.google.com/p/chromium/issues/detail?id=12066 (fixing our proxy
connection limits), which might let me fix this too.  This is a moot point for
now, so splitting out the current code into a separate function is strictly a
good thing.

Powered by Google App Engine
This is Rietveld 408576698