| Index: runtime/bin/vmstats_impl.cc
|
| ===================================================================
|
| --- runtime/bin/vmstats_impl.cc (revision 19094)
|
| +++ runtime/bin/vmstats_impl.cc (working copy)
|
| @@ -157,7 +157,11 @@
|
| // Read request.
|
| // TODO(tball): support partial reads, possibly needed for POST uploads.
|
| char buffer[BUFSIZE + 1];
|
| - int len = read(socket, buffer, BUFSIZE);
|
| + size_t count = FDUtils::AvailableBytes(socket);
|
| + if (count > BUFSIZE) {
|
| + count = BUFSIZE;
|
| + }
|
| + intptr_t len = FDUtils::ReadFromBlocking(socket, buffer, count);
|
| if (len <= 0) {
|
| // Invalid HTTP request, ignore.
|
| continue;
|
|
|