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

Issue 225005: Change the SSL Socket to be capable of having reads and... (Closed)

Created:
11 years, 3 months ago by Mike Belshe
Modified:
9 years, 5 months ago
Reviewers:
wtc
CC:
chromium-reviews_googlegroups.com, darin (slow to review)
Visibility:
Public.

Description

Change the SSL Socket to be capable of having reads and writes active concurrently. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=28664

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 16

Patch Set 3 : '' #

Total comments: 50

Patch Set 4 : '' #

Total comments: 32

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Total comments: 26

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -232 lines) Patch
M net/socket/ssl_client_socket_win.h View 1 2 3 4 5 6 7 4 chunks +37 lines, -15 lines 0 comments Download
M net/socket/ssl_client_socket_win.cc View 1 2 3 4 5 6 7 8 9 21 chunks +295 lines, -217 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Mike Belshe
Wan-Teh - I'd like to add more tests with this change. The current unit tests ...
11 years, 3 months ago (2009-09-23 12:42:47 UTC) #1
wtc
Mike, thanks for the CL and sorry it took me so long to review it. ...
11 years, 2 months ago (2009-09-28 21:22:16 UTC) #2
Mike Belshe
http://codereview.chromium.org/225005/diff/1001/1003 File net/socket/ssl_client_socket_win.cc (right): http://codereview.chromium.org/225005/diff/1001/1003#newcode292 Line 292: #pragma warning(suppress: 4355) On 2009/09/28 21:22:16, wtc wrote: ...
11 years, 2 months ago (2009-09-28 22:22:08 UTC) #3
wtc
I made a pass through the CL. I reviewed all the code carefully except the ...
11 years, 2 months ago (2009-10-02 17:58:30 UTC) #4
Mike Belshe
http://codereview.chromium.org/225005/diff/5002/6002 File net/socket/ssl_client_socket_win.cc (left): http://codereview.chromium.org/225005/diff/5002/6002#oldcode480 Line 480: completed_handshake_ = false; On 2009/10/02 17:58:30, wtc wrote: ...
11 years, 2 months ago (2009-10-02 20:12:35 UTC) #5
wtc
You're now using mutual recursion for both Read and Write. I still think mutual recursion ...
11 years, 2 months ago (2009-10-08 01:32:02 UTC) #6
Mike Belshe
http://codereview.chromium.org/225005/diff/11001/12002 File net/socket/ssl_client_socket_win.cc (right): http://codereview.chromium.org/225005/diff/11001/12002#newcode603 Line 603: // If there is no callback available to ...
11 years, 2 months ago (2009-10-08 21:03:23 UTC) #7
wtc
LGTM. This CL can't get stuck in code reviews forever. I think we should check ...
11 years, 2 months ago (2009-10-09 19:23:47 UTC) #8
Mike Belshe
11 years, 2 months ago (2009-10-09 22:03:13 UTC) #9
http://codereview.chromium.org/225005/diff/17004/15008
File net/socket/ssl_client_socket_win.cc (right):

http://codereview.chromium.org/225005/diff/17004/15008#newcode294
Line 294: &SSLClientSocketWin::OnHandshakeIOComplete)),
On 2009/10/09 19:23:47, wtc wrote:
> Nit: indentation of this line needs updating.

Done.

http://codereview.chromium.org/225005/diff/17004/15008#newcode565
Line 565: user_read_callback_ = callback;
On 2009/10/09 19:23:47, wtc wrote:
> Why don't we need an "else" block that resets user_read_buf_
> and user_read_buf_len_?

This is already done inside of DoPayloadRead().  If the result was not
ERR_IO_PENDING, DoPayloadRead() already zeroed these two.

As per discussion, I have done this.
> 
> The reason I keep pressing you on this issue is that this
> part of Read() (when the Read completes synchronously) should
> be identical to the part of OnReadComplete() right before
> the c->Run() call (when the Read completes asynchronously).
> But they're different.

http://codereview.chromium.org/225005/diff/17004/15008#newcode584
Line 584: user_write_callback_ = callback;
On 2009/10/09 19:23:47, wtc wrote:
> Why don't we need an "else" block that resets user_write_buf_
> and user_write_buf_len_?
> 
> This part of Write() (when the Write completes synchronously)
> should be identical to the part of OnWriteComplete() right
> before the c->Run() call (when the Write completes
> asynchronously).

Done.

http://codereview.chromium.org/225005/diff/17004/15008#newcode608
Line 608: CompletionCallback* c = user_read_callback_;
On 2009/10/09 19:23:47, wtc wrote:
> This part (lines 608-610) should be identical to lines
> 627-631 in OnReadComplete, because both are notifying the
> caller of an asynchronous Read completion.

Done.

http://codereview.chromium.org/225005/diff/17004/15008#newcode623
Line 623: if (result >= 0)
No, we don't. fixed.

On 2009/10/09 19:23:47, wtc wrote:
> Do we still need to decrypt the payload if result is 0?

http://codereview.chromium.org/225005/diff/17004/15008#newcode955
Line 955: if (rv < 0)
On 2009/10/09 19:23:47, wtc wrote:
> Do we still need to decrypt the payload if rv is 0?

Done.

http://codereview.chromium.org/225005/diff/17004/15008#newcode963
Line 963: user_read_buf_ = NULL;
On 2009/10/09 19:23:47, wtc wrote:
> I would just do this at the end of Read() and OnReadCompelte().

Done.

http://codereview.chromium.org/225005/diff/17004/15008#newcode976
Line 976: if (result == ERR_IO_PENDING)
Moved the check to the caller.

On 2009/10/09 19:23:47, wtc wrote:
> This check violates an invariant of the original code:
> we never pass ERR_IO_PENDING to a DoFooComplete() function,
> because by definition the STATE_FOO_COMPLETE state means
> the FOO operation has completed, so the result cannot be
> ERR_IO_PENDING.
> 
> So we need to fix the code at line 954 to call
> DoPayloadReadComplete() only if (rv != ERR_IO_PENDING).
> See how you do that in DoPayloadWrite() at line 1190.

http://codereview.chromium.org/225005/diff/17004/15008#newcode989
Line 989: return ERR_SSL_PROTOCOL_ERROR;
On 2009/10/09 19:23:47, wtc wrote:
> Don't we also need to reset ransport_read_buf_ before
> returning ERR_SSL_PROTOCOL_ERROR?
> 
> You may want to reset transport_read_buf_ first.

Done.

http://codereview.chromium.org/225005/diff/17004/15008#newcode1106
Line 1106: OnHandshakeIOComplete(OK);
On 2009/10/09 19:23:47, wtc wrote:
> I suggest that we just do
>   return DoLoop(OK);
> here.

Done.

http://codereview.chromium.org/225005/diff/17004/15008#newcode1192
Line 1192: user_write_buf_ = NULL;
On 2009/10/09 19:23:47, wtc wrote:
> I would just do this at the end of Write() and OnWriteCompelte().

Done.

http://codereview.chromium.org/225005/diff/17004/15007
File net/socket/ssl_client_socket_win.h (right):

http://codereview.chromium.org/225005/diff/17004/15007#newcode70
Line 70: int DoVerifyCertComplete(int result);
On 2009/10/09 19:23:47, wtc wrote:
> Nit: let's add a blank line here to suggest that the following
> DoXXX functions are no longer part of the state machine.

Done.

http://codereview.chromium.org/225005/diff/17004/15007#newcode71
Line 71: int DoPayloadDecrypt();
Ok - I was trying to match the ordering of the read functions.  I don't really
care - but the 'style' is not explicit.

On 2009/10/09 19:23:47, wtc wrote:
> Nit: list DoPayloadDecrypt after DoPayloadReadComplete,
> which matches the order in which these functions are called.

Powered by Google App Engine
This is Rietveld 408576698