| 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 ea3f93f21fbe9103a32fc1fb52b76dc0779da104..c50d9fec4f2c05035e2824f61696616eb291330d 100644
|
| --- a/native_client_sdk/src/libraries/nacl_io/mount_http.cc
|
| +++ b/native_client_sdk/src/libraries/nacl_io/mount_http.cc
|
| @@ -233,11 +233,14 @@ int MountNodeHttp::GetStat(struct stat* stat) {
|
|
|
|
|
| size_t entity_length;
|
| - if (ParseContentLength(response_headers, &entity_length))
|
| + if (ParseContentLength(response_headers, &entity_length)) {
|
| SetCachedSize(static_cast<off_t>(entity_length));
|
| - else
|
| + } else if (cache_content_ && !has_cached_size_) {
|
| + DownloadToCache();
|
| + } else {
|
| // Don't use SetCachedSize here -- it is actually unknown.
|
| stat_.st_size = 0;
|
| + }
|
|
|
| stat_.st_atime = 0; // TODO(binji): Use "Last-Modified".
|
| stat_.st_mtime = 0;
|
|
|