Ignore:
Timestamp:
Feb 27, 2018, 4:17:05 PM (6 years ago)
Author:
djay
Message:

Use curl_multi_wait only in case libcurl minor version number is upper or equal to 28.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/ulinet.c

    r864 r871  
    561561    mc = curl_multi_perform(hInternet->handle, &still_running);
    562562    if(mc==CURLM_OK){
     563#if LIBCURL_VERSION_MINOR >= 28
    563564      mc = curl_multi_wait(hInternet->handle, NULL, 0, 1000, &numfds);
     565#else
     566      struct timeval timeout;
     567      fd_set fdread;
     568      fd_set fdwrite;
     569      fd_set fdexcep;
     570      int maxfd = -1;
     571
     572      long curl_timeo = -1;
     573
     574      FD_ZERO(&fdread);
     575      FD_ZERO(&fdwrite);
     576      FD_ZERO(&fdexcep);
     577
     578      /* set a suitable timeout to play around with */
     579      timeout.tv_sec = 1;
     580      timeout.tv_usec = 0;
     581
     582      curl_multi_timeout(hInternet->handle, &curl_timeo);
     583      if(curl_timeo >= 0) {
     584        timeout.tv_sec = curl_timeo / 1000;
     585        if(timeout.tv_sec > 1)
     586          timeout.tv_sec = 1;
     587        else
     588          timeout.tv_usec = (curl_timeo % 1000) * 1000;
     589      }
     590
     591      /* get file descriptors from the transfers */
     592      mc = curl_multi_fdset(hInternet->handle, &fdread, &fdwrite, &fdexcep, &maxfd);
     593#endif
    564594    }
    565595    if(mc != CURLM_OK) {
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png