aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/http_upload.cc
diff options
context:
space:
mode:
authorted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-11-02 12:22:35 +0000
committerted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-11-02 12:22:35 +0000
commitfeff0b300f1032862f6474142bd1bf95f457af98 (patch)
treede7509b4bf31daa341e13b1b60d8671d6af15e52 /src/common/linux/http_upload.cc
parentIssue 196 - Breakpad processor support for x86-64. r=mento (diff)
downloadbreakpad-feff0b300f1032862f6474142bd1bf95f457af98.tar.xz
Issue 221 - HTTPUpload::SendRequest should provide error code or error description to callers. r=Liu Li
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@228 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux/http_upload.cc')
-rw-r--r--src/common/linux/http_upload.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/linux/http_upload.cc b/src/common/linux/http_upload.cc
index 8556cfc0..4896edd0 100644
--- a/src/common/linux/http_upload.cc
+++ b/src/common/linux/http_upload.cc
@@ -61,12 +61,15 @@ bool HTTPUpload::SendRequest(const string &url,
const string &file_part_name,
const string &proxy,
const string &proxy_user_pwd,
- string *response_body) {
+ string *response_body,
+ string *error_description) {
if (!CheckParameters(parameters))
return false;
CURL *curl = curl_easy_init();
CURLcode err_code = CURLE_OK;
+ if (error_description != NULL)
+ *error_description = "No Error";
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
@@ -114,6 +117,8 @@ bool HTTPUpload::SendRequest(const string &url,
url.c_str(),
curl_easy_strerror(err_code));
#endif
+ if (error_description != NULL)
+ *error_description = curl_easy_strerror(err_code);
if (curl != NULL)
curl_easy_cleanup(curl);