remove select totally for timeout cannot work properly
This commit is contained in:
parent
49db24b7d4
commit
e791a14c6e
5 changed files with 5 additions and 27 deletions
|
@ -1,4 +1,4 @@
|
||||||
node-curl[](http://travis-ci.org/jiangmiao/node-curl)
|
node-curl [](http://travis-ci.org/jiangmiao/node-curl)
|
||||||
=========
|
=========
|
||||||
|
|
||||||
node cURL wrapper, support all options and infos.
|
node cURL wrapper, support all options and infos.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by ToffeeScript 1.1.4-4
|
// Generated by ToffeeScript 1.2.0-0
|
||||||
(function() {
|
(function() {
|
||||||
var assert, curl, i, j, next, once, _i;
|
var assert, curl, i, j, next, once, _i;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by ToffeeScript 1.1.4-4
|
// Generated by ToffeeScript 1.2.0-0
|
||||||
(function() {
|
(function() {
|
||||||
var curl, fs, p, url, util,
|
var curl, fs, p, url, util,
|
||||||
_this = this;
|
_this = this;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by ToffeeScript 1.1.4-4
|
// Generated by ToffeeScript 1.2.0-0
|
||||||
(function() {
|
(function() {
|
||||||
var Curl, curl, curl_id, curls,
|
var Curl, curl, curl_id, curls,
|
||||||
__slice = [].slice,
|
__slice = [].slice,
|
||||||
|
|
|
@ -285,29 +285,7 @@ class NodeCurl
|
||||||
if (running_handles > 0)
|
if (running_handles > 0)
|
||||||
{
|
{
|
||||||
CURLMcode code;
|
CURLMcode code;
|
||||||
int max_fd = FD_SETSIZE;
|
// remove select totally for timeout doesn't work properly
|
||||||
fd_set read_fds;
|
|
||||||
fd_set write_fds;
|
|
||||||
fd_set error_fds;
|
|
||||||
FD_ZERO(&read_fds);
|
|
||||||
FD_ZERO(&write_fds);
|
|
||||||
FD_ZERO(&error_fds);
|
|
||||||
// use select because of libuv didn't support sockfd well
|
|
||||||
code = curl_multi_fdset(curlm, &read_fds, &write_fds, &error_fds, &max_fd);
|
|
||||||
if (code != CURLM_OK)
|
|
||||||
{
|
|
||||||
return raise("curl_multi_fdset failed", curl_multi_strerror(code));
|
|
||||||
}
|
|
||||||
if (max_fd > 0)
|
|
||||||
{
|
|
||||||
timeval tv = {0};
|
|
||||||
int n = select(max_fd+1, &read_fds, &write_fds, &error_fds, &tv);
|
|
||||||
if (n == 0)
|
|
||||||
{
|
|
||||||
return v8::Integer::New(running_handles);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
code = curl_multi_perform(curlm, &running_handles);
|
code = curl_multi_perform(curlm, &running_handles);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue