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

Issue 10408042: net: Fix a regression that broke file uploading with http authentication (Closed)

Created:
8 years, 7 months ago by satorux1
Modified:
8 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

net: Fix a regression that broke file uploading with http authentication This is a reland of r138168, which was reverted speculatively, but identified unrelated. When uploading a file with http authentication, UploadData is reused for a new UploadDataStream. Hence, we should close the files in UploadData if already opened and read, so we can reread the files from the beginning. The regression was caused by r123677. Special thanks to thomas.themel for identifying the offending patch and helping us to fix the issue. BUG=128574 TEST=added a unit test; manually confirmed that uploading a file with basic authentication, and multi-round authentication with NTLM and Negotiate worked. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=138191

Patch Set 1 #

Total comments: 13

Patch Set 2 : address comments #

Total comments: 2

Patch Set 3 : to reland #

Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -2 lines) Patch
M net/base/upload_data.h View 1 chunk +3 lines, -2 lines 0 comments Download
M net/base/upload_data.cc View 1 chunk +14 lines, -0 lines 0 comments Download
M net/base/upload_data_stream_unittest.cc View 1 2 chunks +43 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
satorux1
8 years, 7 months ago (2012-05-21 17:53:15 UTC) #1
cbentzel
On 2012/05/21 17:53:15, satorux1 wrote: +asanka due to HTTP authentication-related issue
8 years, 7 months ago (2012-05-21 18:02:47 UTC) #2
willchan no longer on Chromium
Can you update the changelist description with manual testing instructions, beyond just the unittest? https://chromiumcodereview.appspot.com/10408042/diff/1/net/base/upload_data.cc ...
8 years, 7 months ago (2012-05-21 18:12:51 UTC) #3
willchan no longer on Chromium
https://chromiumcodereview.appspot.com/10408042/diff/1/net/base/upload_data_stream_unittest.cc File net/base/upload_data_stream_unittest.cc (right): https://chromiumcodereview.appspot.com/10408042/diff/1/net/base/upload_data_stream_unittest.cc#newcode174 net/base/upload_data_stream_unittest.cc:174: scoped_ptr<UploadDataStream> stream(new UploadDataStream(upload_data_)); Any special reason to use a ...
8 years, 7 months ago (2012-05-21 18:17:35 UTC) #4
satorux1
http://codereview.chromium.org/10408042/diff/1/net/base/upload_data.cc File net/base/upload_data.cc (right): http://codereview.chromium.org/10408042/diff/1/net/base/upload_data.cc#newcode125 net/base/upload_data.cc:125: file_stream_->CloseSync(); On 2012/05/21 18:12:51, willchan wrote: > Is this ...
8 years, 7 months ago (2012-05-21 19:37:00 UTC) #5
willchan no longer on Chromium
lgtm http://codereview.chromium.org/10408042/diff/1/net/base/upload_data.cc File net/base/upload_data.cc (right): http://codereview.chromium.org/10408042/diff/1/net/base/upload_data.cc#newcode125 net/base/upload_data.cc:125: file_stream_->CloseSync(); On 2012/05/21 19:37:00, satorux1 wrote: > On ...
8 years, 7 months ago (2012-05-21 20:27:40 UTC) #6
asanka
LGTM.
8 years, 7 months ago (2012-05-21 20:28:20 UTC) #7
satorux1
will submit shortly. http://codereview.chromium.org/10408042/diff/1/net/base/upload_data.cc File net/base/upload_data.cc (right): http://codereview.chromium.org/10408042/diff/1/net/base/upload_data.cc#newcode125 net/base/upload_data.cc:125: file_stream_->CloseSync(); On 2012/05/21 20:27:40, willchan wrote: ...
8 years, 7 months ago (2012-05-21 20:40:46 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/satorux@chromium.org/10408042/9001
8 years, 7 months ago (2012-05-21 20:45:34 UTC) #9
commit-bot: I haz the power
Presubmit check for 10408042-9001 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 7 months ago (2012-05-21 20:45:53 UTC) #10
wtc
Patch set 2 LGTM. Feel free to ignore my suggestion below. I'm just offering it ...
8 years, 7 months ago (2012-05-21 22:54:41 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/satorux@chromium.org/10408042/9001
8 years, 7 months ago (2012-05-21 23:12:34 UTC) #12
commit-bot: I haz the power
Presubmit check for 10408042-9001 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 7 months ago (2012-05-21 23:12:41 UTC) #13
wtc
http://codereview.chromium.org/10408042/diff/1/net/base/upload_data.h File net/base/upload_data.h (right): http://codereview.chromium.org/10408042/diff/1/net/base/upload_data.h#newcode172 net/base/upload_data.h:172: FileStream* file_stream_; On 2012/05/21 19:37:00, satorux1 wrote: > > ...
8 years, 7 months ago (2012-05-21 23:13:11 UTC) #14
satorux1
http://codereview.chromium.org/10408042/diff/9001/net/base/upload_data.cc File net/base/upload_data.cc (right): http://codereview.chromium.org/10408042/diff/9001/net/base/upload_data.cc#newcode128 net/base/upload_data.cc:128: } On 2012/05/21 22:54:41, wtc wrote: > As a ...
8 years, 7 months ago (2012-05-21 23:14:40 UTC) #15
willchan no longer on Chromium
8 years, 7 months ago (2012-05-21 23:38:55 UTC) #16
http://codereview.chromium.org/10408042/diff/1/net/base/upload_data.h
File net/base/upload_data.h (right):

http://codereview.chromium.org/10408042/diff/1/net/base/upload_data.h#newcode172
net/base/upload_data.h:172: FileStream* file_stream_;
On 2012/05/21 23:13:11, wtc wrote:
> 
> On 2012/05/21 19:37:00, satorux1 wrote:
> >
> > IIRC, I once tried to make it a scoped_ptr but failed as the
> UploadData::Element
> > has to be copyable (the Element class is hold as std::vector<Element> in
> > UploadData) but making it a scoped_ptr makes it non-copyable.
> 
> Should we use base/memory/linked_ptr.h to deal with this?
>     base::link_ptr<FileStream> file_stream_;
> should allow UploadData::Element to be copyable.  But I'm
> not sure about the current opinion about base/memory/linked_ptr.h.

I don't think we should do this. The fundamental problem is that this isn't
truly copyable. The FileStream should *not* be shared across
UploadData::Elements. The way it works right now is fragile, I think we rely on
convention that we don't actually ever copy the vector. The Elements are only
copied when resizing the vector.

Powered by Google App Engine
This is Rietveld 408576698