TurboGit/hubicfuse

Patch for issue with large file (up to 2GiB) on 32 bit OS

Closed this issue · 2 comments

Hi,

This patch must be tested on 64 bit OS !!

In cloudfsapi.c lines 639 and 973 replace
long flen;
by
off_t flen;

In cloudfsapi.c line 485 replace (See libcurl API doc)
curl_easy_setopt(curl, CURLOPT_INFILESIZE, file_size);
by
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_size);

In cloudfsapi.c line 1016 replace
snprintf(manifest, MAX_URL_SIZE, "%s_segments/%s/%s/%ld/%ld/",
by
snprintf(manifest, MAX_URL_SIZE, "%s_segments/%s/%s/%lld/%ld/",
for -Wformat error.

In commonfs.c line 100 replace
sprintf(nsec_str, "%d", nsec);
by
sprintf(nsec_str, "%ld", nsec);
for -Wformat error.

No need to compile with the option -D_FILE_OFFSET_BITS=64

Thanks

Will include this, thanks.

From: bronco0 [mailto:notifications@github.com]
Sent: Friday, January 15, 2016 17:26
To: TurboGit/hubicfuse hubicfuse@noreply.github.com
Subject: [hubicfuse] Patch for issue with large file (up to 2GiB) on 32 bit OS (#110)

Hi,

This patch must be tested on 64 bit OS !!

In cloudfsapic lines 639 https://githubcom/TurboGit/hubicfuse/blob/master/cloudfsapic#L639 and 973 https://githubcom/TurboGit/hubicfuse/blob/master/cloudfsapic#L973 replace
long flen;
by
off_t flen;

In cloudfsapic line 485 https://githubcom/TurboGit/hubicfuse/blob/master/cloudfsapic#L485 replace (See libcurl API doc http://curlhaxxse/libcurl/c/CURLOPT_INFILESIZEhtml )
curl_easy_setopt(curl, CURLOPT_INFILESIZE, file_size);
by
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_size);

In cloudfsapic line 1016 https://githubcom/TurboGit/hubicfuse/blob/master/cloudfsapic#L1016 replace
snprintf(manifest, MAX_URL_SIZE, "%s_segments/%s/%s/%ld/%ld/",
by
snprintf(manifest, MAX_URL_SIZE, "%s_segments/%s/%s/%lld/%ld/",
for -Wformat error

In commonfsc line 100 https://githubcom/TurboGit/hubicfuse/blob/master/commonfsc#L100 replace
sprintf(nsec_str, "%d", nsec);
by
sprintf(nsec_str, "%ld", nsec);
for -Wformat error

No need to compile with the option -D_FILE_OFFSET_BITS=64

Thanks


Reply to this email directly or view it on GitHub #110 . https://github.com/notifications/beacon/AKO69x9oWVKcV0mJxikXw4S447KQzVtuks5paQcGgaJpZM4HFzD9.gif

Closing, all those should be fixed now.