Chromium Code Reviews| Index: native_client_sdk/src/libraries/nacl_io/httpfs/http_fs_node.cc |
| diff --git a/native_client_sdk/src/libraries/nacl_io/httpfs/http_fs_node.cc b/native_client_sdk/src/libraries/nacl_io/httpfs/http_fs_node.cc |
| index b02c0af2d6a31d84a02ad6aab4e7d74cb0a4b38a..5cd89d0c9c4d9f73211fd814829aa8d7fe396e5c 100644 |
| --- a/native_client_sdk/src/libraries/nacl_io/httpfs/http_fs_node.cc |
| +++ b/native_client_sdk/src/libraries/nacl_io/httpfs/http_fs_node.cc |
| @@ -88,7 +88,7 @@ bool ParseContentLength(const StringMap_t& headers, size_t* content_length) { |
| if (iter == headers.end()) |
| return false; |
| - *content_length = strtoul(iter->second.c_str(), NULL, 10); |
| + *content_length = strtoull(iter->second.c_str(), NULL, 10); |
| return true; |
| } |
| @@ -198,7 +198,7 @@ Error HttpFsNode::Write(const HandleAttr& attr, |
| return EACCES; |
| } |
| -Error HttpFsNode::GetSize(size_t* out_size) { |
| +Error HttpFsNode::GetSize(off_t* out_size) { |
| *out_size = 0; |
| // TODO(binji): This value should be cached properly; i.e. obey the caching |
| @@ -258,7 +258,7 @@ Error HttpFsNode::GetStat_Locked(struct stat* stat) { |
| // "Content-Length" header. Read the entire entity, and throw it away. |
| // Don't use DownloadToCache, as that will still allocate enough memory |
| // for the entire entity. |
| - int bytes_read; |
| + off_t bytes_read; |
| error = DownloadToTemp(&bytes_read); |
| if (error) |
| return error; |
| @@ -420,7 +420,7 @@ Error HttpFsNode::DownloadPartial(const HandleAttr& attr, |
| // Range request is inclusive: 0-99 returns 100 bytes. |
| snprintf(&buffer[0], |
| sizeof(buffer), |
| - "bytes=%" PRIuS "-%" PRIuS, |
| + "bytes=%llu-%llu", |
|
Sam Clegg
2014/05/02 17:36:06
I'm not sure %llu works on windows can you use PRI
Matthew Turk
2014/05/02 18:47:43
Done. Had to include some additional headers to m
|
| attr.offs, |
| attr.offs + count - 1); |
| headers["Range"] = buffer; |
| @@ -501,7 +501,7 @@ Error HttpFsNode::DownloadPartial(const HandleAttr& attr, |
| return ReadResponseToBuffer(loader, buf, count, out_bytes); |
| } |
| -Error HttpFsNode::DownloadToTemp(int* out_bytes) { |
| +Error HttpFsNode::DownloadToTemp(off_t* out_bytes) { |
| StringMap_t headers; |
| ScopedResource loader(filesystem_->ppapi()); |
| ScopedResource request(filesystem_->ppapi()); |
| @@ -528,7 +528,7 @@ Error HttpFsNode::DownloadToTemp(int* out_bytes) { |
| } |
| Error HttpFsNode::ReadEntireResponseToTemp(const ScopedResource& loader, |
| - int* out_bytes) { |
| + off_t* out_bytes) { |
| *out_bytes = 0; |
| const int kBytesToRead = MAX_READ_BUFFER_SIZE; |