mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-05 04:17:52 +00:00
fix curl_multi_timeout bug found on mac
git-svn-id: http://s3fs.googlecode.com/svn/trunk@101 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
parent
4af3aa98ae
commit
efec7c8f76
@ -1161,16 +1161,18 @@ s3fs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset,
|
|||||||
time_t milliseconds;
|
time_t milliseconds;
|
||||||
VERIFY(curl_multi_timeout(multi_handle.get(), &milliseconds));
|
VERIFY(curl_multi_timeout(multi_handle.get(), &milliseconds));
|
||||||
|
|
||||||
if (milliseconds > 0) {
|
if (milliseconds != -1) {
|
||||||
struct timeval timeout;
|
if (milliseconds > 0) {
|
||||||
timeout.tv_sec = 0;
|
struct timeval timeout;
|
||||||
timeout.tv_usec = 1000*milliseconds;
|
timeout.tv_sec = 0;
|
||||||
|
timeout.tv_usec = 1000*milliseconds;
|
||||||
|
|
||||||
int max_fd;
|
int max_fd;
|
||||||
VERIFY(curl_multi_fdset(multi_handle.get(), &read_fd_set, &write_fd_set, &exc_fd_set, &max_fd));
|
VERIFY(curl_multi_fdset(multi_handle.get(), &read_fd_set, &write_fd_set, &exc_fd_set, &max_fd));
|
||||||
|
|
||||||
if (select(max_fd + 1, &read_fd_set, &write_fd_set, &exc_fd_set, &timeout) == -1)
|
if (select(max_fd + 1, &read_fd_set, &write_fd_set, &exc_fd_set, &timeout) == -1)
|
||||||
Yikes(-errno);
|
Yikes(-errno);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (curl_multi_perform(multi_handle.get(), &running_handles) == CURLM_CALL_MULTI_PERFORM)
|
while (curl_multi_perform(multi_handle.get(), &running_handles) == CURLM_CALL_MULTI_PERFORM)
|
||||||
|
Loading…
Reference in New Issue
Block a user