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

Issue 11366155: SSLClientSocket::IsConnected should care for internal buffers (Closed)

Created:
8 years, 1 month ago by Takashi Toyoshima
Modified:
7 years, 11 months ago
CC:
chromium-reviews
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

SSLClientSocket::IsConnected should care for internal buffers SSLClientSocket::IsConnected() and SSLClientSocket::IsConnectedAndIdle() may return false though it has buffered data. They should care for internally processing buffer. There are various implementation, for NSS, OpenSSL, and platform dependent system libraries. This CL fix the issue on NSS. Fix for others will follow. BUG=160033 TEST=browser_tests, net_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=178775

Patch Set 1 #

Patch Set 2 : plan 2 #

Patch Set 3 : same change on IsConnectedAndIdle #

Patch Set 4 : same change on nss #

Total comments: 14

Patch Set 5 : fix #

Patch Set 6 : add unit test #

Total comments: 25

Patch Set 7 : rebase only #

Patch Set 8 : reflect #9 #

Patch Set 9 : reflects #10 comments on test #

Patch Set 10 : Ryan's alternative fix #

Patch Set 11 : rebase to new rev. #

Total comments: 10

Patch Set 12 : fix closure handling #

Patch Set 13 : Split _win fix to another CL #

Total comments: 29

Patch Set 14 : reflect comments except for CloseNotify handling #

Patch Set 15 : rebase #

Patch Set 16 : handle logical EOFs #

Patch Set 17 : remove comments #

Total comments: 13

Patch Set 18 : review #30 #

Total comments: 4

Patch Set 19 : replace sync EOF check into core #

Patch Set 20 : rebase (for try) #

Total comments: 20

Patch Set 21 : fix DCHECK errors #

Patch Set 22 : one more pitfall #

Total comments: 10

Patch Set 23 : reflect obvious comments #

Patch Set 24 : fix IsConnectedAndIdle #

Patch Set 25 : clarify function assignment #

Total comments: 2

Patch Set 26 : for submit #

Patch Set 27 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+297 lines, -37 lines) Patch
A chrome/browser/net/websocket_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +94 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +1 line, -0 lines 0 comments Download
M net/base/nss_memio.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +5 lines, -0 lines 0 comments Download
M net/base/nss_memio.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +8 lines, -0 lines 0 comments Download
M net/data/websocket/README View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +13 lines, -0 lines 0 comments Download
A net/data/websocket/close-with-split-packet_wsh.py View 1 2 3 4 5 6 7 14 15 16 17 18 1 chunk +30 lines, -0 lines 0 comments Download
A + net/data/websocket/split_packet_check.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -8 lines 0 comments Download
M net/socket/ssl_client_socket_nss.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 15 chunks +136 lines, -29 lines 0 comments Download

Messages

Total messages: 44 (0 generated)
Takashi Toyoshima
Hi Wan-Teh, I landed a CL on tcp_client_socket_win.cc before. http://codereview.chromium.org/8083031 We need a similar CL ...
8 years, 1 month ago (2012-11-09 04:30:31 UTC) #1
Takashi Toyoshima
Hi Wan-Tech, Sorry, Patch Set 3 is not enough. I'll request review again once I'm ...
8 years, 1 month ago (2012-11-09 10:29:45 UTC) #2
Takashi Toyoshima
I revised my CL to apply same modification on nss because Win uses nss by ...
8 years, 1 month ago (2012-11-12 11:39:41 UTC) #3
wtc
Review comments on patch set 4: Thank you for the CL. This is an interesting ...
8 years, 1 month ago (2012-11-13 20:03:57 UTC) #4
wtc
I just found that in patch sets 2 and 3, you only modified ssl_client_socket_win.cc. But ...
8 years, 1 month ago (2012-11-13 20:06:32 UTC) #5
Takashi Toyoshima
Thank you for reviewing this. > Why did you fix that file first? Are you ...
8 years, 1 month ago (2012-11-15 11:10:24 UTC) #6
Takashi Toyoshima
+tyoshino Can you look net/data/websocket/* expecially on _wsh.py? +wtc I added browser tests for ws:// ...
8 years ago (2012-12-06 12:28:44 UTC) #7
wtc
On 2012/12/06 12:28:44, Takashi Toyoshima (chromium) wrote: > > I added browser tests for ws:// ...
8 years ago (2012-12-10 20:08:28 UTC) #8
tyoshino (SeeGerritForStatus)
LGTM https://codereview.chromium.org/11366155/diff/19001/net/data/websocket/README File net/data/websocket/README (right): https://codereview.chromium.org/11366155/diff/19001/net/data/websocket/README#newcode11 net/data/websocket/README:11: change title to "PASS" to notify content::TitleWatcher. changes ...
8 years ago (2012-12-14 15:13:54 UTC) #9
wtc
Review comments on patch set 6: rsleevi: It's now time to have you involved in ...
8 years ago (2012-12-14 22:55:14 UTC) #10
Ryan Sleevi
https://chromiumcodereview.appspot.com/11366155/diff/19001/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): https://chromiumcodereview.appspot.com/11366155/diff/19001/net/socket/ssl_client_socket_nss.cc#newcode2876 net/socket/ssl_client_socket_nss.cc:2876: ret = transport_->socket()->IsConnected(); I discussed with Wan-Teh and would ...
8 years ago (2012-12-15 01:03:04 UTC) #11
Takashi Toyoshima
I resume this CL. Firstly, I reflect tyoshino's comments though I'll change direction as Wan-Teh ...
8 years ago (2012-12-21 06:39:03 UTC) #12
Takashi Toyoshima
Sorry for split responses. I'll try to do essential fix in the next patch set. ...
8 years ago (2012-12-21 07:43:03 UTC) #13
Takashi Toyoshima
A happy new year, and sorry for lazy update on this. I implement Ryan's plan ...
7 years, 11 months ago (2013-01-07 17:00:05 UTC) #14
Ryan Sleevi
https://codereview.chromium.org/11366155/diff/48004/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): https://codereview.chromium.org/11366155/diff/48004/net/socket/ssl_client_socket_nss.cc#newcode576 net/socket/ssl_client_socket_nss.cc:576: // UpdateReadStatus() NACK on this. The intention of PostOrRunCallback ...
7 years, 11 months ago (2013-01-07 18:59:04 UTC) #15
Takashi Toyoshima
Thank you, Ryan. Patch Set 12 fixes thread and closure problems. Could you review it ...
7 years, 11 months ago (2013-01-08 06:25:38 UTC) #16
Ryan Sleevi
the _nss and _win changes look good to me, but is this not also an ...
7 years, 11 months ago (2013-01-08 07:25:59 UTC) #17
Takashi Toyoshima
Thanks. Other owners on net/data/websocket have taken long leave now. tyoshino is TL of our ...
7 years, 11 months ago (2013-01-08 07:40:39 UTC) #18
Takashi Toyoshima
Hi, Ryan. Currently I have no clear idea to have an equivalent test for openssl ...
7 years, 11 months ago (2013-01-08 14:43:27 UTC) #19
Ryan Sleevi
On 2013/01/08 14:43:27, Takashi Toyoshima (chromium) wrote: > Hi, Ryan. > > Currently I have ...
7 years, 11 months ago (2013-01-09 00:38:54 UTC) #20
Takashi Toyoshima
Hi, Similar fix should be applied to _mac and _openssl. And I should add another ...
7 years, 11 months ago (2013-01-09 09:56:12 UTC) #21
Ryan Sleevi
On 2013/01/09 09:56:12, Takashi Toyoshima (chromium) wrote: > Hi, > > Similar fix should be ...
7 years, 11 months ago (2013-01-09 18:49:55 UTC) #22
Ryan Sleevi
https://codereview.chromium.org/11366155/diff/60005/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): https://codereview.chromium.org/11366155/diff/60005/net/socket/ssl_client_socket_nss.cc#newcode2977 net/socket/ssl_client_socket_nss.cc:2977: else if (core_->HasUnhandledData()) BUG: I think there's a bug ...
7 years, 11 months ago (2013-01-09 19:01:52 UTC) #23
Takashi Toyoshima
I split the change to three CLs, this CL, for --use-system-ssl, and for OpenSSL. Now ...
7 years, 11 months ago (2013-01-10 07:46:29 UTC) #24
Ryan Sleevi
https://codereview.chromium.org/11366155/diff/60005/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): https://codereview.chromium.org/11366155/diff/60005/net/socket/ssl_client_socket_nss.cc#newcode3002 net/socket/ssl_client_socket_nss.cc:3002: else if (core_->HasUnhandledData()) On 2013/01/10 07:46:29, Takashi Toyoshima (chromium) ...
7 years, 11 months ago (2013-01-10 08:01:23 UTC) #25
Takashi Toyoshima
https://codereview.chromium.org/11366155/diff/60005/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): https://codereview.chromium.org/11366155/diff/60005/net/socket/ssl_client_socket_nss.cc#newcode3002 net/socket/ssl_client_socket_nss.cc:3002: else if (core_->HasUnhandledData()) Ah, I see. You mean that ...
7 years, 11 months ago (2013-01-10 08:17:14 UTC) #26
wtc
Review comments on patch set 13: Thank you for the new patch sets. I suggest ...
7 years, 11 months ago (2013-01-14 20:50:08 UTC) #27
Takashi Toyoshima
Thank you, Wan and Ryan. Yeah, SSLClientSocketNSS is complicated more than expected... Anyway, I reflect ...
7 years, 11 months ago (2013-01-15 13:46:03 UTC) #28
Takashi Toyoshima
OK. Patch set 16 handles CloseNotify, unexpected close by errors, and so on. I think ...
7 years, 11 months ago (2013-01-15 14:41:41 UTC) #29
wtc
Review comments on patch set 17: I believe the code related to unhandled_buffer_size_ has bugs. ...
7 years, 11 months ago (2013-01-16 00:34:16 UTC) #30
Takashi Toyoshima
Thanks. Also I abandoned the CL for system libraries. https://codereview.chromium.org/11366155/diff/60005/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): https://codereview.chromium.org/11366155/diff/60005/net/socket/ssl_client_socket_nss.cc#newcode2199 net/socket/ssl_client_socket_nss.cc:2199: ...
7 years, 11 months ago (2013-01-16 07:16:03 UTC) #31
Ryan Sleevi
https://codereview.chromium.org/11366155/diff/96005/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): https://codereview.chromium.org/11366155/diff/96005/net/socket/ssl_client_socket_nss.cc#newcode3010 net/socket/ssl_client_socket_nss.cc:3010: !core_->IsClosed() && On 2013/01/16 07:16:03, Takashi Toyoshima (chromium) wrote: ...
7 years, 11 months ago (2013-01-18 00:03:24 UTC) #32
Takashi Toyoshima
https://codereview.chromium.org/11366155/diff/96005/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): https://codereview.chromium.org/11366155/diff/96005/net/socket/ssl_client_socket_nss.cc#newcode3010 net/socket/ssl_client_socket_nss.cc:3010: !core_->IsClosed() && OK, I move the logic for ssl_is_closed_ ...
7 years, 11 months ago (2013-01-21 14:51:16 UTC) #33
Ryan Sleevi
You've still got a lot of broken threading here. Highlighted below. https://codereview.chromium.org/11366155/diff/139001/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): ...
7 years, 11 months ago (2013-01-21 16:33:29 UTC) #34
Takashi Toyoshima
Can you tell me the way to flip the threading model? I'd like to check ...
7 years, 11 months ago (2013-01-22 02:03:26 UTC) #35
Ryan Sleevi
On 2013/01/22 02:03:26, Takashi Toyoshima (chromium) wrote: > Can you tell me the way to ...
7 years, 11 months ago (2013-01-22 02:48:05 UTC) #36
Takashi Toyoshima
Thank you Ryan. I fixed some threading bugs in the patch set 22. https://codereview.chromium.org/11366155/diff/139001/net/socket/ssl_client_socket_nss.cc File ...
7 years, 11 months ago (2013-01-22 14:16:49 UTC) #37
Ryan Sleevi
Mostly LGTM, but one question, and a few nits. I think we're in the home ...
7 years, 11 months ago (2013-01-23 01:46:20 UTC) #38
Takashi Toyoshima
As you said, buffer update operations and waiting flags reset operations are handled vaguely. I ...
7 years, 11 months ago (2013-01-23 06:53:02 UTC) #39
Ryan Sleevi
I'm not entirely thrilled with the multiple PostOrRunCallbacks, since it's non-ideal for performance. Considering that ...
7 years, 11 months ago (2013-01-23 20:12:55 UTC) #40
Takashi Toyoshima
Sorry for leaving performance issue behind. I'll submit this CL now. https://codereview.chromium.org/11366155/diff/139010/net/socket/ssl_client_socket_nss.cc File net/socket/ssl_client_socket_nss.cc (right): ...
7 years, 11 months ago (2013-01-25 06:32:39 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/11366155/140048
7 years, 11 months ago (2013-01-25 06:33:26 UTC) #42
commit-bot: I haz the power
Presubmit check for 11366155-140048 failed and returned exit status 1. Running presubmit commit checks ...
7 years, 11 months ago (2013-01-25 06:33:31 UTC) #43
Takashi Toyoshima
7 years, 11 months ago (2013-01-25 06:36:11 UTC) #44
Oops.
I'll use try and dcommit for now because wtc@, one of chrome/browser/net OWNER
already review the part.

Powered by Google App Engine
This is Rietveld 408576698