mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-01 20:24:40 +01:00
Allows the caller of CrashReportSender::SendCrashReport() to determine that
the server rejected a crash report, by changing the return value from a boolean to a tri-state enum. Fixes issue #101. Reviewed by mmentovai. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@99 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
5ac2b9a569
commit
d4e527b7ee
5 changed files with 48 additions and 16 deletions
|
|
@ -66,7 +66,12 @@ bool HTTPUpload::SendRequest(const wstring &url,
|
|||
const map<wstring, wstring> ¶meters,
|
||||
const wstring &upload_file,
|
||||
const wstring &file_part_name,
|
||||
wstring *response_body) {
|
||||
wstring *response_body,
|
||||
int *response_code) {
|
||||
if (response_code) {
|
||||
*response_code = 0;
|
||||
}
|
||||
|
||||
// TODO(bryner): support non-ASCII parameter names
|
||||
if (!CheckParameters(parameters)) {
|
||||
return false;
|
||||
|
|
@ -153,7 +158,12 @@ bool HTTPUpload::SendRequest(const wstring &url,
|
|||
return false;
|
||||
}
|
||||
|
||||
bool result = (wcscmp(http_status, L"200") == 0);
|
||||
int http_response = wcstol(http_status, NULL, 10);
|
||||
if (response_code) {
|
||||
*response_code = http_response;
|
||||
}
|
||||
|
||||
bool result = (http_response == 200);
|
||||
|
||||
if (result) {
|
||||
result = ReadResponse(request.get(), response_body);
|
||||
|
|
|
|||
|
|
@ -63,11 +63,14 @@ class HTTPUpload {
|
|||
// Only HTTP(S) URLs are currently supported. Returns true on success.
|
||||
// If the request is successful and response_body is non-NULL,
|
||||
// the response body will be returned in response_body.
|
||||
// If response_code is non-NULL, it will be set to the HTTP response code
|
||||
// received (or 0 if the request failed before getting an HTTP response).
|
||||
static bool SendRequest(const wstring &url,
|
||||
const map<wstring, wstring> ¶meters,
|
||||
const wstring &upload_file,
|
||||
const wstring &file_part_name,
|
||||
wstring *response_body);
|
||||
wstring *response_body,
|
||||
int *response_code);
|
||||
|
||||
private:
|
||||
class AutoInternetHandle;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue