diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-03 21:48:28 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-03 21:48:28 +0000 |
commit | 947b39a720fa43841eb1c1c4904119e6adb357f7 (patch) | |
tree | 5729b8eee48b23c79cba1937db364eddbd63f68a /chrome_frame | |
parent | 37e2a80818f55b47dc9b58cb52c7c08f0bf9b166 (diff) | |
download | chromium_src-947b39a720fa43841eb1c1c4904119e6adb357f7.zip chromium_src-947b39a720fa43841eb1c1c4904119e6adb357f7.tar.gz chromium_src-947b39a720fa43841eb1c1c4904119e6adb357f7.tar.bz2 |
Fix chunked uploads in Chrome Frame.
Fixes a Chrome Frame regression from http://crrev.com/117588
Also fixes a failing CF net test, URLRequestTestHTTP.TestPostChunkedDataBeforeStart.
BUG=112459
TEST=chrome_frame_tests.exe
Review URL: http://codereview.chromium.org/9316067
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120404 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/urlmon_url_request.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index e640694..f0f0e27 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -502,12 +502,12 @@ STDMETHODIMP UrlmonUrlRequest::GetBindInfo(DWORD* bind_flags, if (bind_info->dwBindVerb != BINDVERB_CUSTOM) bind_info->szCustomVerb = NULL; - if (post_data_len() && + if ((post_data_len() || is_chunked_upload()) && get_upload_data(&bind_info->stgmedData.pstm) == S_OK) { bind_info->stgmedData.tymed = TYMED_ISTREAM; -#pragma warning(disable:4244) - bind_info->cbstgmedData = post_data_len(); -#pragma warning(default:4244) + if (!is_chunked_upload()) { + bind_info->cbstgmedData = static_cast<DWORD>(post_data_len()); + } DVLOG(1) << __FUNCTION__ << me() << method() << " request with " << base::Int64ToString(post_data_len()) << " bytes. url=" << url(); @@ -602,10 +602,8 @@ STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url, HRESULT hr = S_OK; std::string new_headers; - if (post_data_len() > 0) { - if (is_chunked_upload()) { - new_headers = base::StringPrintf("Transfer-Encoding: chunked\r\n"); - } + if (is_chunked_upload()) { + new_headers = base::StringPrintf("Transfer-Encoding: chunked\r\n"); } if (!extra_headers().empty()) { |