summaryrefslogtreecommitdiffstats
path: root/net/base/upload_data_stream.cc
Commit message (Collapse)AuthorAgeFilesLines
* FBTF: Move a bunch of code to the headers and remove includes.erg@google.com2010-09-221-0/+1
| | | | | | | | | BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3412016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60208 0039d316-1c4b-4281-b951-d872f2087c98
* Moving file_util::FileInfo to base::PlatformFileInfo, and adding thedumi@chromium.org2010-09-031-1/+1
| | | | | | | | | | | | last_accessed and creation_time fields. BUG=none TEST=none Review URL: http://codereview.chromium.org/3347005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58454 0039d316-1c4b-4281-b951-d872f2087c98
* Report unreadable files as size zero when uploading.vandebo@chromium.org2010-03-291-45/+38
| | | | | | | | | | | Upload zero bytes if the file size shrinks. BUG=30850 TEST=uploading an unreadable file works Review URL: http://codereview.chromium.org/1250002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42981 0039d316-1c4b-4281-b951-d872f2087c98
* Support sending a sliced file in chromium.jianli@chromium.org2010-03-241-2/+28
| | | | | | | | | BUG=none TEST=The WebKit Layout test. Review URL: http://codereview.chromium.org/594036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42559 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 42152 - Fix the case where the browser livelocks if we cannot open a ↵vandebo@chromium.org2010-03-191-30/+20
| | | | | | | | | | | | | | | | | | | | | | file. If one tries to upload a file that one doesn't have read access to, the browser livelocks. It tries to read from the file, gets nothing but spins forever because it knows that it hasn't finished reading. To address this, firstly we add a check at stat() time to make sure that we can read the file. However, this doesn't take care of the case where the access() call was incorrect, or the permissions have changed under us. In this case, we replace the missing file with NULs. BUG=30850 Review URL: http://codereview.chromium.org/541022 TBR=vandebo@chromium.org Review URL: http://codereview.chromium.org/1145004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42154 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the case where the browser livelocks if we cannot open a file.vandebo@chromium.org2010-03-191-20/+30
| | | | | | | | | | | | | | | | | If one tries to upload a file that one doesn't have read access to, the browser livelocks. It tries to read from the file, gets nothing but spins forever because it knows that it hasn't finished reading. To address this, firstly we add a check at stat() time to make sure that we can read the file. However, this doesn't take care of the case where the access() call was incorrect, or the permissions have changed under us. In this case, we replace the missing file with NULs. BUG=30850 Review URL: http://codereview.chromium.org/541022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42152 0039d316-1c4b-4281-b951-d872f2087c98
* Use CHECK_* in netwillchan@chromium.org2010-03-021-2/+1
| | | | | | Review URL: http://codereview.chromium.org/660404 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40453 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix the case where the browser livelocks if we cannot open a file."agl@chromium.org2010-03-011-30/+20
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40291 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the case where the browser livelocks if we cannot open a file.agl@chromium.org2010-02-261-20/+30
| | | | | | | | | | | | | | | | | | | | If one tries to upload a file that one doesn't have read access to, the browser livelocks. It tries to read from the file, gets nothing but spins forever because it knows that it hasn't finished reading. To address this, firstly we add a check at stat() time to make sure that we can read the file. However, this doesn't take care of the case where the access() call was incorrect, or the permissions have changed under us. In this case, we replace the missing file with NULs. (Land attempt three: first in r39446, reverted in r39448. Second in r39899, reverted in r39901.) http://codereview.chromium.org/541022 BUG=30850 TEST=Try to upload a file that isn't readable (i.e. /etc/shadow). The resulting upload should be a 0 byte file. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40146 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix the case where the browser livelocks if we cannot open a file."agl@chromium.org2010-02-241-28/+19
| | | | | | (Still breaks Mac net_unittests. Damm you Mac.) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39901 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the case where the browser livelocks if we cannot open a file.agl@chromium.org2010-02-241-19/+28
| | | | | | | | | | | | | | | | | | | If one tries to upload a file that one doesn't have read access to, the browser livelocks. It tries to read from the file, gets nothing but spins forever because it knows that it hasn't finished reading. To address this, firstly we add a check at stat() time to make sure that we can read the file. However, this doesn't take care of the case where the access() call was incorrect, or the permissions have changed under us. In this case, we replace the missing file with NULs. (Land attempt two: first in r39446, reverted in r39448) http://codereview.chromium.org/541022 BUG=30850 TEST=Try to upload a file that isn't readable (i.e. /etc/shadow). The resulting upload should be a 0 byte file. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39899 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r39446: "Fix the case where the browser livelocks if we cannot open a ↵agl@chromium.org2010-02-191-28/+19
| | | | | | | | file." This somehow broke net_unittests on the Mac. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39448 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the case where the browser livelocks if we cannot open a file.agl@chromium.org2010-02-191-19/+28
| | | | | | | | | | | | | | | | | If one tries to upload a file that one doesn't have read access to, the browser livelocks. It tries to read from the file, gets nothing but spins forever because it knows that it hasn't finished reading. To address this, firstly we add a check at stat() time to make sure that we can read the file. However, this doesn't take care of the case where the access() call was incorrect, or the permissions have changed under us. In this case, we replace the missing file with NULs. http://codereview.chromium.org/541022 BUG=30850 TEST=Try to upload a file that isn't readable (i.e. /etc/shadow). The resulting upload should be a 0 byte file. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39446 0039d316-1c4b-4281-b951-d872f2087c98
* Add a notion of 'eof' to UploadDataStream, replacing the use of its size ↵vandebo@google.com2010-02-041-2/+7
| | | | | | | | | | | | | | | property for detecting when an upload is finished. While this does prevent the crash described in the bug from occurring, this doesn't fully solve the problem as now the affected uploads don't complete. Fully resolving the issue will require implementing the chunked transfer encoding for requests. Patch from Vernon Tang <vt@foilhead.net>, original review: http://codereview.chromium.org/555194 BUG=33501 TEST=Create a file with a non-zero size and select that file in an HTML-based uploader. Before starting the upload, remove read permissions from that file. Check that the upload doesn't cause the browser to crash or hang. net_unittests: HttpNetworkTransactionTest.UploadFileSmallerThanLength, UploadDataStreamTest.* Review URL: http://codereview.chromium.org/578004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38129 0039d316-1c4b-4281-b951-d872f2087c98
* Try to find the cause of the crash in memcpy, called from DoSendBody.vandebo@chromium.org2009-11-191-1/+2
| | | | | | | | | BUG=27870 TEST=none Review URL: http://codereview.chromium.org/404034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32544 0039d316-1c4b-4281-b951-d872f2087c98
* Reduce header dependencies in net/phajdan.jr@chromium.org2009-05-291-0/+1
| | | | | | | | TEST=none Review URL: http://codereview.chromium.org/115870 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17178 0039d316-1c4b-4281-b951-d872f2087c98
* Use IOBuffers on UploadDataStream.rvargas@google.com2009-05-111-3/+5
| | | | | | | | | | | | This is some cleanup of cl 14998. R=wtc BUG=9258 TEST=none Review URL: http://codereview.chromium.org/115157 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15812 0039d316-1c4b-4281-b951-d872f2087c98
* Switching things to FilePath:phajdan.jr@chromium.org2009-04-071-6/+6
| | | | | | | | | | | | | | | | Remove following deprecated wstring-using functions: net/net_util: FilePathToFileURL net/net_util: FileURLToFilePath Switch net/base/upload_data to FilePath. Switch upload-related parts of net/url_request/url_request to FilePath. Made necessary adjustments in rest of code (a lot). Review URL: http://codereview.chromium.org/63011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13242 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-111-1/+0
| | | | | | | | | Normalize end of file newlines in net/. All files end in a single newline. Review URL: http://codereview.chromium.org/43079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11442 0039d316-1c4b-4281-b951-d872f2087c98
* Change FileStream to use FilePath instead of wstring.erikkay@google.com2009-01-261-1/+2
| | | | | | Review URL: http://codereview.chromium.org/18764 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8663 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the UploadDataStream::Reset method. Instead,wtc@google.com2008-11-051-12/+7
| | | | | | | | | | | | | | | | rewind an UploadDataStream by recreating the object. Fix a bug in MockTCPClientSocket::Write. It needs to increment write_index_. Add two DCHECKs to simulate the DCHECKS in SSLClientSocketWin::DoPayloadEncrypt. Add a unit test. R=darin,eroman BUG=4062 Review URL: http://codereview.chromium.org/9384 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4819 0039d316-1c4b-4281-b951-d872f2087c98
* * Add write and read/write support to FileStream (renamed from FileInputStream).erikkay@google.com2008-11-031-1/+3
| | | | | | | | * Moved net/disk_cache/os_file to base/platform_file. Review URL: http://codereview.chromium.org/8843 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4454 0039d316-1c4b-4281-b951-d872f2087c98
* Define FileInputStream and use it to make UpdateDataStream and ↵darin@google.com2008-09-291-66/+31
| | | | | | | | | | | | URLRequestFileJob portable. file_input_stream_posix.cc is not implemented in this CL. That is saved for a follow-up. R=mark Review URL: http://codereview.chromium.org/4101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2673 0039d316-1c4b-4281-b951-d872f2087c98
* add http layer and unit tests to mac build. stub out file uploading in ↵pinkerton@google.com2008-09-251-0/+16
| | | | | | | | upload_data_stream until we have a common file wrapper. Review URL: http://codereview.chromium.org/4090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2599 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Large patch set (159 files total) to cleanup the includes.maruel@google.com2008-08-151-0/+2
| | | | | | | | | | - Slightly reduce the size of the generated .lib files ~3%. - Reduce the number of implicit and explicit atl and windows includes. hooray! - Help incremental build by reducing the number of unnecessary included files. - Split some template class in two, one base class for the common code and the specialization that inherits from the base class. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@937 0039d316-1c4b-4281-b951-d872f2087c98
* Add net to the repository.initial.commit2008-07-261-0/+151
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14 0039d316-1c4b-4281-b951-d872f2087c98