Additional hack to handle the case the data pipe is completely full If the data pipe is completely full, the state goes to SHOULD_WAIT. Change-Id: I432480a3d9e4bd206832f9968bb0ee52ed51b5b2
diff --git a/mojo/services/network/http_client.h b/mojo/services/network/http_client.h index 6e3e672..4619473 100644 --- a/mojo/services/network/http_client.h +++ b/mojo/services/network/http_client.h
@@ -269,6 +269,11 @@ MojoResult result = BeginWriteDataRaw(response_body_stream_.get(), &buf, &num_bytes, MOJO_WRITE_DATA_FLAG_NONE); + if (result == MOJO_RESULT_SHOULD_WAIT) { + // TODO(toshik): we should handle this condition with AsyncWaiter + usleep(1000); + continue; + } if (result != MOJO_RESULT_OK) { std::cout << "Warning: SendBody: BeginWriteDataRAW: result=" << result << std::endl;