Skip to content

Commit

Permalink
Fixes #323 - we should start to handle maxfd == -1 case
Browse files Browse the repository at this point in the history
  • Loading branch information
taf2 committed Aug 25, 2017
1 parent b88d649 commit b3d265b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ext/curb_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,15 @@ VALUE ruby_curl_multi_perform(int argc, VALUE *argv, VALUE self) {
raise_curl_multi_error_exception(mcode);
}

if (maxfd == -1) {
/* libcurl recommends sleeping for 100ms */
rb_thread_wait_for(rb_time_timeval(DBL2NUM(0.1)));
rb_curl_multi_run( self, rbcm->handle, &(rbcm->running) );
rb_curl_multi_read_info( self, rbcm->handle );
if (block != Qnil) { rb_funcall(block, rb_intern("call"), 1, self); }
continue;
}

#ifdef _WIN32
create_crt_fd(&fdread, &crt_fdread);
create_crt_fd(&fdwrite, &crt_fdwrite);
Expand Down

0 comments on commit b3d265b

Please sign in to comment.