mirror of
https://github.com/chromium/crashpad.git
synced 2025-01-13 16:58:04 +08:00
win: Handle the case when GetBytesBuffer returns error in HTTPTransportWin
HTTPBodyStream::GetBytesBuffer returns negative number on error. Change-Id: I9958fb35d65e894067d71e8f37c30ff8948cd90d Reviewed-on: https://chromium-review.googlesource.com/366360 Reviewed-by: Scott Graham <scottmg@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
7c807242e0
commit
6f6242865d
1
AUTHORS
1
AUTHORS
@ -7,3 +7,4 @@
|
||||
# The email address is not required for organizations.
|
||||
|
||||
Google Inc.
|
||||
Opera Software ASA
|
||||
|
@ -179,8 +179,12 @@ bool HTTPTransportWin::ExecuteSynchronously(std::string* response_body) {
|
||||
uint8_t buffer[kBufferSize];
|
||||
FileOperationResult bytes_to_write =
|
||||
body_stream()->GetBytesBuffer(buffer, sizeof(buffer));
|
||||
if (bytes_to_write == 0)
|
||||
if (bytes_to_write == 0) {
|
||||
break;
|
||||
} else if (bytes_to_write < 0) {
|
||||
LOG(ERROR) << "GetBytesBuffer failed";
|
||||
return false;
|
||||
}
|
||||
post_data.insert(post_data.end(), buffer, buffer + bytes_to_write);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user