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

Issue 149043: Make new FtpNetworkTransaction handle short reads correctly.... (Closed)

Created:
11 years, 6 months ago by Paweł Hajdan Jr.
Modified:
9 years, 7 months ago
Reviewers:
eroman, wtc, ibrar
CC:
chromium-reviews_googlegroups.com, darin (slow to review), willchan no longer on Chromium
Visibility:
Public.

Description

Make new FtpNetworkTransaction handle short reads correctly. The problem was that some functions were parsing response lines, but without checking that they have the entire line available. This change will also make it easier to handle multi-line greeting (230 welcome messages). I plan to do that afterwards. TEST=Covered by net_unittests. http://crbug.com/15259 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=19954

Patch Set 1 #

Total comments: 15

Patch Set 2 : '' #

Patch Set 3 : fixes #

Total comments: 7

Patch Set 4 : updated #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+246 lines, -160 lines) Patch
M net/base/io_buffer.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M net/ftp/ftp_network_transaction.h View 1 2 3 4 chunks +39 lines, -20 lines 0 comments Download
M net/ftp/ftp_network_transaction.cc View 1 2 3 21 chunks +151 lines, -93 lines 2 comments Download
M net/ftp/ftp_network_transaction_unittest.cc View 1 2 3 3 chunks +55 lines, -46 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Paweł Hajdan Jr.
11 years, 6 months ago (2009-06-26 00:04:36 UTC) #1
wtc
I will review this tomorrow. Just a quick question on ftp_network_transaction.h. http://codereview.chromium.org/149043/diff/1/4 File net/ftp/ftp_network_transaction.h (right): ...
11 years, 6 months ago (2009-06-26 01:08:06 UTC) #2
wtc
LGTM. Excellent work! Please fix the problems below before you check this in. I go ...
11 years, 6 months ago (2009-06-26 21:22:05 UTC) #3
wtc
http://codereview.chromium.org/149043/diff/1/4 File net/ftp/ftp_network_transaction.h (right): http://codereview.chromium.org/149043/diff/1/4#newcode107 Line 107: int ProcessResponseUSER(ResponseLine response); Another option is to pass ...
11 years, 6 months ago (2009-06-27 01:48:42 UTC) #4
Paweł Hajdan Jr.
eroman, could you look at the changes? I think this update fixes all the problems.
11 years, 5 months ago (2009-07-01 22:44:00 UTC) #5
eroman
lgtm, but please read my comments. http://codereview.chromium.org/149043/diff/2010/3004 File net/ftp/ftp_network_transaction.cc (right): http://codereview.chromium.org/149043/diff/2010/3004#newcode141 Line 141: return Stop(ERR_FAILED); ...
11 years, 5 months ago (2009-07-02 02:34:19 UTC) #6
Paweł Hajdan Jr.
Thanks for catching these issues. I think this new changeset fixes them. It turns out ...
11 years, 5 months ago (2009-07-02 19:34:21 UTC) #7
eroman
11 years, 5 months ago (2009-07-02 22:56:48 UTC) #8
LGTM

http://codereview.chromium.org/149043/diff/9/11
File net/ftp/ftp_network_transaction.cc (right):

http://codereview.chromium.org/149043/diff/9/11#newcode461
Line 461: return Stop(rv);
I am not excited about the use of Stop() in this file, but fine for now.

(Stop() strikes me as fragile, since it returns OK -- depending where this
happens, state machine could advance to other unexpected states; seems the
better thing to do is propagate the failure all the way out).

http://codereview.chromium.org/149043/diff/9/11#newcode467
Line 467: response_message_buf_len_ - cut_pos);
Can you add:

DCHECK_GE(response_message_buf_len_, cut_pos); 

(I presume calling memmove with 0 is a no-op and safe).

Powered by Google App Engine
This is Rietveld 408576698