aboutsummaryrefslogtreecommitdiff
path: root/src/common/windows
diff options
context:
space:
mode:
authornealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-03-20 19:02:12 +0000
committernealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-03-20 19:02:12 +0000
commit3366749ee7fd0e6c94906efa817d257917e3bf82 (patch)
tree2bb8fa0d11b8d037c2b3b21ceeed901640add028 /src/common/windows
parentFix for issues 296, 297. Various symbol supplier classes need to be updated w... (diff)
downloadbreakpad-3366749ee7fd0e6c94906efa817d257917e3bf82.tar.xz
Fix for issue 304: symupload needs to support timeout specifications(wininet can timeout when sending large symbol files).
R=doshimun W=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@319 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/windows')
-rw-r--r--src/common/windows/http_upload.cc19
-rw-r--r--src/common/windows/http_upload.h1
2 files changed, 19 insertions, 1 deletions
diff --git a/src/common/windows/http_upload.cc b/src/common/windows/http_upload.cc
index 2f9ffa92..686c2ab5 100644
--- a/src/common/windows/http_upload.cc
+++ b/src/common/windows/http_upload.cc
@@ -66,12 +66,13 @@ bool HTTPUpload::SendRequest(const wstring &url,
const map<wstring, wstring> &parameters,
const wstring &upload_file,
const wstring &file_part_name,
+ int *timeout,
wstring *response_body,
int *response_code) {
if (response_code) {
*response_code = 0;
}
-
+
// TODO(bryner): support non-ASCII parameter names
if (!CheckParameters(parameters)) {
return false;
@@ -146,6 +147,22 @@ bool HTTPUpload::SendRequest(const wstring &url,
return false;
}
+ if (timeout) {
+ if (!InternetSetOption(request.get(),
+ INTERNET_OPTION_SEND_TIMEOUT,
+ timeout,
+ sizeof(timeout))) {
+ fwprintf(stderr, L"Could not unset send timeout, continuing...\n");
+ }
+
+ if (!InternetSetOption(request.get(),
+ INTERNET_OPTION_RECEIVE_TIMEOUT,
+ timeout,
+ sizeof(timeout))) {
+ fwprintf(stderr, L"Could not unset receive timeout, continuing...\n");
+ }
+ }
+
if (!HttpSendRequest(request.get(), NULL, 0,
const_cast<char *>(request_body.data()),
static_cast<DWORD>(request_body.size()))) {
diff --git a/src/common/windows/http_upload.h b/src/common/windows/http_upload.h
index a1ba7ae1..f7c69f16 100644
--- a/src/common/windows/http_upload.h
+++ b/src/common/windows/http_upload.h
@@ -69,6 +69,7 @@ class HTTPUpload {
const map<wstring, wstring> &parameters,
const wstring &upload_file,
const wstring &file_part_name,
+ int *timeout,
wstring *response_body,
int *response_code);