Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: util/net/http_transport_mac.mm

Issue 1304433004: HTTPTransportMac: CFStream Read() must always set at_eof (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | util/net/http_transport_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/net/http_transport_mac.mm
diff --git a/util/net/http_transport_mac.mm b/util/net/http_transport_mac.mm
index 9688d18cbabb2bf83ee32359ae4b8f6d1eacdb4c..c0ff7d1834e8230a0b3da9f828da0fe449f5fca7 100644
--- a/util/net/http_transport_mac.mm
+++ b/util/net/http_transport_mac.mm
@@ -87,15 +87,17 @@ class HTTPBodyStreamCFReadStream {
CFStreamError* error,
Boolean* at_eof,
void* info) {
- if (buffer_length == 0)
+ if (buffer_length == 0) {
+ *at_eof = FALSE;
return 0;
+ }
ssize_t bytes_read = GetStream(info)->GetBytesBuffer(buffer, buffer_length);
- if (bytes_read == 0) {
- *at_eof = TRUE;
- } else if (bytes_read < 0) {
+ if (bytes_read < 0) {
error->error = -1;
error->domain = kCFStreamErrorDomainCustom;
+ } else {
+ *at_eof = bytes_read == 0;
}
return bytes_read;
« no previous file with comments | « no previous file | util/net/http_transport_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698