Ignore:
Timestamp:
Aug 7, 2017, 2:56:24 PM (7 years ago)
Author:
djay
Message:

Update the source code for HPC support. Automatically adding nested outputs for the HPC support (should this be available for every support?). Add capability to store the metadata in the Collection DataBase?. Addition of the zcfg2sql to import any existing ZCFG file into the Collection DB. Add the support to invoke a callback (for history purpose) in case a [callback] section contains at least one parameter defined (url). Add support to convert maps and map to JSON (for callback use only by now). Fix some memory leaks (some are still there).

File:
1 edited

Legend:

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

    r821 r839  
    7070/**
    7171 * In case of presence of "Set-Cookie" in the headers red, store the cookie
    72  * identifier in CCookie
     72 * identifier in cookie
    7373 *
    7474 * @param buffer the buffer to read
     
    7777 * @param data the _HINTERNET structure to write in
    7878 * @return the size red, -1 if buffer is NULL
    79  * @see CCookie
     79 * @see cookie
    8080 */
    8181size_t header_write_data(void *buffer, size_t size, size_t nmemb, void *data){
    8282  if(strncmp("Set-Cookie: ",(char*)buffer,12)==0){
    8383    int i;
    84     char env[256];
    85     char path[256];
    86     char domain[256];
    8784    char* tmp;
    8885    for(i=0;i<12;i++)
     
    9289        ;
    9390#endif
    94     sscanf((char*)buffer,"%s; path=%s; domain=%s",env,path,domain);
     91    tmp=strtok(buffer,";");
     92    int cnt=0;
    9593    _HINTERNET *psInternet=(_HINTERNET *)data;
    96     tmp=strcat(env,CCookie[psInternet->id][0]);
    97 #ifdef MSG_LAF_OUT
    98     printf("\n**Cookie env : [%s] , path : [%s], domain : [%s]**\n",env,path,domain);
    99     printf("buffer : %d (%s) (%s) (%s)\n",(buffer==NULL),buffer,tmp,CCookie);
    100 #endif
    101     strcpy(CCookie[psInternet->id][0],tmp);
     94    if(tmp!=NULL && psInternet!=NULL){
     95      psInternet->cookie=(char*)malloc(sizeof(char)*(strlen(tmp)+1));
     96      sprintf(psInternet->cookie,"%s",tmp);
     97    }
    10298  }
    10399  return size * nmemb;//write_data_into(buffer,size,nmemb,data,HEADER);
     
    340336    if(handle.url!=NULL)
    341337      free(handle.url);
    342     free(handle.mimeType);
    343     handle.mimeType = NULL;
     338    if(handle.mimeType!=NULL)
     339      free(handle.mimeType);
     340    if(handle.cookie!=NULL)
     341      free(handle.cookie);
    344342  }
    345343  if(handle0->handle)
     
    371369  hInternet->ihandle[hInternet->nb].url = NULL;
    372370  hInternet->ihandle[hInternet->nb].mimeType = NULL;
     371  hInternet->ihandle[hInternet->nb].cookie = NULL;
    373372  hInternet->ihandle[hInternet->nb].nDataLen = 0;
    374373  hInternet->ihandle[hInternet->nb].id = hInternet->nb;
     
    376375  hInternet->ihandle[hInternet->nb].pabyData = NULL;
    377376  hInternet->ihandle[hInternet->nb].post = NULL;
    378 
     377 
    379378  curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle, CURLOPT_COOKIEFILE, "ALL");
    380379#ifndef TIGER
     
    475474    curl_multi_remove_handle(hInternet->handle, hInternet->ihandle[i].handle);
    476475    curl_easy_cleanup(hInternet->ihandle[i].handle);
     476    //fprintf(stderr,"%s %d %s \n",__FILE__,__LINE__,hInternet->ihandle[i].mimeType);
     477    //fprintf(stderr,"%s %d %s \n",__FILE__,__LINE__,hInternet->ihandle[i].pabyData);
    477478  }
    478479  return 0;
     
    480481
    481482/**
    482  * Initialize the CCookie for a specific index (hInternet.nb)
    483  *
    484  * @param hInternet the HINTERNET structure to know the CCookie index to reset
     483 * Initialize the cookie for a specific index (hInternet.nb)
     484 *
     485 * @param hInternet the HINTERNET structure to know the cookie index to reset
    485486 * @return 1
    486487 * @see HINTERNET
    487488 */
    488489int freeCookieList(HINTERNET hInternet){
    489   memset(&CCookie[hInternet.nb][0],0,1024);
     490  hInternet.ihandle[hInternet.nb].cookie=strdup("");
    490491#ifndef TIGER
    491492  curl_easy_setopt(hInternet.ihandle[hInternet.nb].handle, CURLOPT_COOKIELIST, "ALL");
     
    536537  }
    537538
    538   CCookie[hInternet.id][0]=0;
    539 
    540539  if( *lpdwNumberOfBytesRead < dwDataSize )
    541540      return 0;
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