summaryrefslogtreecommitdiff
path: root/extra/moc/curl-streams.diff
diff options
context:
space:
mode:
Diffstat (limited to 'extra/moc/curl-streams.diff')
-rw-r--r--extra/moc/curl-streams.diff28
1 files changed, 28 insertions, 0 deletions
diff --git a/extra/moc/curl-streams.diff b/extra/moc/curl-streams.diff
new file mode 100644
index 000000000..2dbc38d54
--- /dev/null
+++ b/extra/moc/curl-streams.diff
@@ -0,0 +1,28 @@
+diff -u moc-2.4.4/io_curl.c moc-2.4.4/io_curl.c
+--- a/io_curl.c 2007-07-08 08:54:45.000000000 +0200
++++ b/io_curl.c 2011-05-18 09:09:40.000000000 +0200
+@@ -338,6 +338,8 @@
+ fd_set read_fds, write_fds, exc_fds;
+ int max_fd;
+ int ret;
++ long milliseconds;
++ struct timeval timeout;
+
+ logit ("Doing select()...");
+
+@@ -356,8 +358,14 @@
+ if (s->curl.wake_up_pipe[0] > max_fd)
+ max_fd = s->curl.wake_up_pipe[0];
+
++ curl_multi_timeout(s->curl.multi_handle, &milliseconds);
++ if(milliseconds <= 0)
++ milliseconds = 1000; /* just a cautionary default */
++ timeout.tv_sec = milliseconds / 1000;
++ timeout.tv_usec = (milliseconds % 1000) * 1000;
++
+ ret = select (max_fd + 1, &read_fds, &write_fds,
+- &exc_fds, NULL);
++ &exc_fds, &timeout);
+
+ if (ret < 0 && errno == EINTR) {
+ logit ("Interrupted");