Ignore:
Timestamp:
Mar 12, 2015, 3:14:52 AM (9 years ago)
Author:
djay
Message:

Introduce the Process Profiles Registry with its documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/ulinet.c

    r579 r607  
    329329#endif
    330330    curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_POSTFIELDS,lpszHeaders);
    331     //curl_easy_setopt(hInternet->handle,CURLOPT_POSTFIELDSIZE,dwHeadersLength+1);
    332     if(hInternet->ihandle[hInternet->nb].header!=NULL)
    333       curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_HTTPHEADER,hInternet->ihandle[hInternet->nb].header);
    334   }
     331    curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_POSTFIELDSIZE,dwHeadersLength+1);
     332  }
     333  if(hInternet->ihandle[hInternet->nb].header!=NULL)
     334    curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_HTTPHEADER,hInternet->ihandle[hInternet->nb].header);
    335335
    336336  curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_URL,lpszUrl);
     
    366366    if(tmp!=NULL)
    367367      hInternet->ihandle[i].mimeType=strdup(tmp);
     368    curl_easy_getinfo(hInternet->ihandle[i].handle,CURLINFO_RESPONSE_CODE,&hInternet->ihandle[i].code);
    368369    curl_multi_remove_handle(hInternet->handle, hInternet->ihandle[i].handle);
    369370    curl_easy_cleanup(hInternet->ihandle[i].handle);
     
    437438}
    438439
     440
     441/**
     442 * Use basic authentication for accessing a ressource
     443 *
     444 * @param hInternet the _HINTERNET structure
     445 * @param login the login to use to authenticate
     446 * @param passwd the password to use to authenticate
     447 */
     448int setBasicAuth(HINTERNET hInternet,char* login,char* passwd){
     449  char *tmp;
     450  tmp=(char*)malloc((strlen(login)+strlen(passwd)+2)*sizeof(char));
     451  sprintf(tmp,"%s:%s",login,passwd);
     452  if(curl_easy_setopt(hInternet.ihandle[hInternet.nb].handle,CURLOPT_USERPWD,tmp)==CURLE_OUT_OF_MEMORY){
     453    free(tmp);
     454    return -1;
     455  }
     456  curl_easy_setopt(hInternet.ihandle[hInternet.nb].handle, CURLOPT_HTTPAUTH,CURLAUTH_ANY);
     457  free(tmp);
     458  return 0;
     459}
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