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; |