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

Unified Diff: native_client_sdk/src/libraries/nacl_io/mount_http.cc

Issue 13831005: [NaCl SDK] nacl_io: HTTP mount bugfix, w/ packaged app and content cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/nacl_io/mount_http.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_http.cc b/native_client_sdk/src/libraries/nacl_io/mount_http.cc
index c50d9fec4f2c05035e2824f61696616eb291330d..9e862e38a05385a3c41f0d03399666ba1ba8436c 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_http.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_http.cc
@@ -418,10 +418,10 @@ int MountNodeHttp::DownloadToCache() {
// We don't know how big the file is. Read in chunks.
cached_data_.resize(MAX_READ_BUFFER_SIZE);
- char* buf = cached_data_.data();
size_t total_bytes_read = 0;
size_t bytes_to_read = MAX_READ_BUFFER_SIZE;
while (true) {
+ char* buf = cached_data_.data() + total_bytes_read;
int bytes_read = DownloadToBuffer(loader, buf, bytes_to_read);
if (bytes_read < 0)
return -1;
@@ -434,7 +434,6 @@ int MountNodeHttp::DownloadToCache() {
return total_bytes_read;
}
- buf += bytes_read;
cached_data_.resize(total_bytes_read + bytes_to_read);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698