Changeset 871 for branches


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.

Location:
branches/prototype-v0/zoo-project/zoo-kernel
Files:
4 edited

Legend:

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

    r867 r871  
    933933                                    tmpmaps->content =
    934934                                      createMap (list[l], (char *) val);
     935                                  xmlFree (val);
    935936                                }
    936                               xmlFree (val);
     937                              else{
     938                                if(l==0){
     939                                  if (tmpmaps->content != NULL)
     940                                    addToMap (tmpmaps->content, list[l],
     941                                              "string");
     942                                  else
     943                                    tmpmaps->content =
     944                                      createMap (list[l],"string");
     945                                }
     946                              }
    937947                              free (list[l]);
    938948                            }
     
    959969                                      tmpmaps->content =
    960970                                        createMap (coms[l], (char *) val);
     971                                    xmlFree (val);
    961972                                  }
    962                                 xmlFree (val);
    963973                              }
    964974                          }
    965975
    966976                      map *test = getMap (tmpmaps->content, "encoding");
    967 
     977                     
    968978                      if (test == NULL)
    969                         { 
     979                        {
    970980                          if (tmpmaps->content != NULL)
    971981                            addToMap (tmpmaps->content, "encoding",
     
    977987                        }
    978988
    979                       if (strcasecmp (test->value, "base64") != 0)
     989                      if (getMap(tmpmaps->content,"dataType")==NULL && test!=NULL && strcasecmp (test->value, "base64") != 0)
    980990                        {
    981991                          xmlChar *mv = xmlNodeListGetString (doc,
     
    983993                                                              1);
    984994                          map *ltmp =
    985                             getMap (tmpmaps->content, "mimeType");
     995                            getMap (tmpmaps->content, "mimeType");                       
    986996                          if (mv == NULL
    987997                              ||
     
    10681078                      else
    10691079                        {
    1070                           xmlChar *tmp = xmlNodeListGetRawString (doc,
    1071                                                                   cur4->xmlChildrenNode,
    1072                                                                   0);
    1073                           addToMap (tmpmaps->content, "value",
    1074                                     (char *) tmp);
    1075                           xmlFree (tmp);
     1080                          xmlNodePtr cur5 = cur4->children;
     1081                          while (cur5 != NULL
     1082                                 && cur5->type != XML_CDATA_SECTION_NODE)
     1083                            cur5 = cur5->next;
     1084                          if (cur5 != NULL
     1085                              && cur5->type == XML_CDATA_SECTION_NODE)
     1086                            {
     1087                              addToMap (tmpmaps->content,
     1088                                        "value",
     1089                                        (char *) cur5->content);
     1090                            }
     1091                          else{
     1092                            if(cur4->xmlChildrenNode!=NULL){
     1093                              xmlChar *tmp = xmlNodeListGetRawString (doc,
     1094                                                                      cur4->xmlChildrenNode,
     1095                                                                      0);
     1096                              addToMap (tmpmaps->content, "value",
     1097                                        (char *) tmp);
     1098                              xmlFree (tmp);
     1099                            }
     1100                          }
    10761101                        }
    10771102
  • branches/prototype-v0/zoo-project/zoo-kernel/service.c

    r860 r871  
    925925  }
    926926
    927   char *tmpV[12]={
     927  char *tmpV[14]={
    928928    (char*)"size",
    929929    (char*)"value",
     
    937937    (char*)"schema",
    938938    (char*)"encoding",
    939     (char*)"isCached"
     939    (char*)"isCached",
     940    (char*)"LowerCorner",
     941    (char*)"UpperCorner"
    940942  };
    941943  sprintf(tmpLen,"%d",len+1);
    942944  addToMap(_cursor->content,"length",tmpLen);
    943945  int i=0;
    944   for(i=0;i<12;i++){
     946  for(i=0;i<14;i++){
    945947    map* tmpVI=getMap(tmp->content,tmpV[i]);
    946948    if(tmpVI!=NULL){
  • 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) {
  • branches/prototype-v0/zoo-project/zoo-kernel/ulinet.h

    r863 r871  
    3030#include <fcntl.h>
    3131#include <curl/curl.h>
     32#include <curl/curlver.h>
    3233#include "service.h"
    3334#ifndef WIN32
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