diff options
author | mark@chromium.org <mark@chromium.org> | 2014-09-03 13:40:40 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org> | 2014-09-03 13:40:40 +0000 |
commit | a58de86bcd085c035f3e7103b6c15fee72b97753 (patch) | |
tree | a96b5e6f783b761c15c0cdef8afcfc1c52a6ec73 /src/common/linux | |
parent | Adding possibility for client to upload the file (diff) | |
download | breakpad-a58de86bcd085c035f3e7103b6c15fee72b97753.tar.xz |
Back out trunk r1367.
Compile error: https://bugzilla.mozilla.org/show_bug.cgi?id=1048091#c15
Review URL: https://breakpad.appspot.com/9694002
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1369 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux')
-rw-r--r-- | src/common/linux/http_upload.cc | 15 | ||||
-rw-r--r-- | src/common/linux/http_upload.h | 9 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/common/linux/http_upload.cc b/src/common/linux/http_upload.cc index 4492fe84..d49f2276 100644 --- a/src/common/linux/http_upload.cc +++ b/src/common/linux/http_upload.cc @@ -56,7 +56,8 @@ static const char kUserAgent[] = "Breakpad/1.0 (Linux)"; // static bool HTTPUpload::SendRequest(const string &url, const map<string, string> ¶meters, - const map<string, string> &files, + const string &upload_file, + const string &file_part_name, const string &proxy, const string &proxy_user_pwd, const string &ca_certificate_file, @@ -134,13 +135,11 @@ bool HTTPUpload::SendRequest(const string &url, CURLFORM_COPYCONTENTS, iter->second.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); - } + // Add form file. + (*curl_formadd)(&formpost, &lastptr, + CURLFORM_COPYNAME, file_part_name.c_str(), + CURLFORM_FILE, upload_file.c_str(), + CURLFORM_END); (*curl_easy_setopt)(curl, CURLOPT_HTTPPOST, formpost); diff --git a/src/common/linux/http_upload.h b/src/common/linux/http_upload.h index 4f0e452f..6dd36ea0 100644 --- a/src/common/linux/http_upload.h +++ b/src/common/linux/http_upload.h @@ -45,9 +45,9 @@ using std::map; class HTTPUpload { public: - // Sends the given sets of parameters and files as a multipart POST - // request to the given URL. - // Each key in |files| is the name of the file part of the request + // Sends the given set of parameters, along with the contents of + // upload_file, as a multipart POST request to the given URL. + // file_part_name contains the name of the file part of the request // (i.e. it corresponds to the name= attribute on an <input type="file">. // Parameter names must contain only printable ASCII characters, // and may not contain a quote (") character. @@ -60,7 +60,8 @@ class HTTPUpload { // returned in error_description. static bool SendRequest(const string &url, const map<string, string> ¶meters, - const map<string, string> &files, + const string &upload_file, + const string &file_part_name, const string &proxy, const string &proxy_user_pwd, const string &ca_certificate_file, |