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

Issue 3107013: Fix a bug in the mock sockets. For SSL sockets, when they were... (Closed)

Created:
10 years, 4 months ago by Mike Belshe
Modified:
9 years, 5 months ago
Reviewers:
eroman, Ryan Hamilton
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Fix a bug in the mock sockets. For SSL sockets, when they were completing the connect asynchronously, we never set the connected_ flag to true. This is usually benign, because we don't often check the flag. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=56219

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M net/socket/socket_test_util.cc View 1 chunk +2 lines, -2 lines 1 comment Download

Messages

Total messages: 4 (0 generated)
Mike Belshe
10 years, 4 months ago (2010-08-16 02:55:15 UTC) #1
Ryan Hamilton
LGTM. This fix resolved the problem I was having in my Https proxy tests. Awesome!
10 years, 4 months ago (2010-08-16 18:58:38 UTC) #2
eroman
apologies this got buried in my review queue and didn't notice it until now. looks ...
10 years, 4 months ago (2010-08-21 02:48:09 UTC) #3
Mike Belshe
10 years, 4 months ago (2010-08-21 03:14:20 UTC) #4
On 2010/08/21 02:48:09, eroman wrote:
> apologies this got buried in my review queue and didn't notice it until now.
> 
> looks good, but I don't think this is the best fix.
> 
> http://codereview.chromium.org/3107013/diff/1/2
> File net/socket/socket_test_util.cc (right):
> 
> http://codereview.chromium.org/3107013/diff/1/2#newcode365
> net/socket/socket_test_util.cc:365: connected_ = true;
> It would be better to only set connected_ to true right before we call the
user
> callback.

I don't think so - the MockSocket is trying to simulate the real network, and
the real network behaves like this code does.  First, we hit the IO which may
cause the socket to be connected, an then, sometime later, the callback fires
notifying the delegate that hey - we're connected...  So this is simulating
exactly that condition.

Obviously the gap between actually connecting and the user-callback may vary on
different types of sockets.

Powered by Google App Engine
This is Rietveld 408576698