diff options
author | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com> | 2014-08-28 15:26:59 +0000 |
---|---|---|
committer | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com> | 2014-08-28 15:26:59 +0000 |
commit | 8cde5c515272f3cf2eb67f4f62969467f47aabe8 (patch) | |
tree | bf4efd922a1c249bfb0a6085897306c29bbe540e /src/common/linux/http_upload.cc | |
parent | constructor init list in wrong order in CrashGenerationServer (diff) | |
download | breakpad-8cde5c515272f3cf2eb67f4f62969467f47aabe8.tar.xz |
Support for multiple upload files in CrashReportSender/HTTPUpload
A=David Major <dmajor@mozilla.com> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=1048091
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1367 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux/http_upload.cc')
-rw-r--r-- | src/common/linux/http_upload.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/common/linux/http_upload.cc b/src/common/linux/http_upload.cc index d49f2276..4492fe84 100644 --- a/src/common/linux/http_upload.cc +++ b/src/common/linux/http_upload.cc @@ -56,8 +56,7 @@ static const char kUserAgent[] = "Breakpad/1.0 (Linux)"; // static bool HTTPUpload::SendRequest(const string &url, const map<string, string> ¶meters, - const string &upload_file, - const string &file_part_name, + const map<string, string> &files, const string &proxy, const string &proxy_user_pwd, const string &ca_certificate_file, @@ -135,11 +134,13 @@ bool HTTPUpload::SendRequest(const string &url, CURLFORM_COPYCONTENTS, iter->second.c_str(), CURLFORM_END); - // Add form file. - (*curl_formadd)(&formpost, &lastptr, - CURLFORM_COPYNAME, file_part_name.c_str(), - CURLFORM_FILE, upload_file.c_str(), - CURLFORM_END); + // Add form files. + for (iter = files.begin(); iter != files.end(); ++iter) { + (*curl_formadd)(&formpost, &lastptr, + CURLFORM_COPYNAME, iter->first.c_str(), + CURLFORM_FILE, iter->second.c_str(), + CURLFORM_END); + } (*curl_easy_setopt)(curl, CURLOPT_HTTPPOST, formpost); |