Changeset 470 for trunk/zoo-project/zoo-kernel/ulinet.c
- Timestamp:
- May 2, 2014, 11:19:03 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/ulinet.c
r446 r470 170 170 ret.mimeType = NULL; 171 171 172 ret.handle=curl_ easy_init();173 174 curl_ easy_setopt(ret.handle, CURLOPT_COOKIEFILE, "ALL");172 ret.handle=curl_share_init(); 173 174 curl_share_setopt(ret.handle, CURLOPT_COOKIEFILE, "ALL"); 175 175 #ifndef TIGER 176 curl_ easy_setopt(ret.handle, CURLOPT_COOKIELIST, "ALL");177 #endif 178 curl_ easy_setopt(ret.handle, CURLOPT_USERAGENT, lpszAgent);179 180 curl_ easy_setopt(ret.handle,CURLOPT_FOLLOWLOCATION,1);181 curl_ easy_setopt(ret.handle,CURLOPT_MAXREDIRS,3);176 curl_share_setopt(ret.handle, CURLOPT_COOKIELIST, "ALL"); 177 #endif 178 curl_share_setopt(ret.handle, CURLOPT_USERAGENT, lpszAgent); 179 180 curl_share_setopt(ret.handle,CURLOPT_FOLLOWLOCATION,1); 181 curl_share_setopt(ret.handle,CURLOPT_MAXREDIRS,3); 182 182 183 183 header.memory=NULL; 184 184 header.size = 0; 185 185 186 curl_ easy_setopt(ret.handle, CURLOPT_HEADERFUNCTION, header_write_data);187 curl_ easy_setopt(ret.handle, CURLOPT_WRITEHEADER, (void *)&header);188 189 #ifdef MSG_LAF_VERBOSE 190 curl_ easy_setopt(ret.handle, CURLOPT_VERBOSE, 1);186 curl_share_setopt(ret.handle, CURLOPT_HEADERFUNCTION, header_write_data); 187 curl_share_setopt(ret.handle, CURLOPT_WRITEHEADER, (void *)&header); 188 189 #ifdef MSG_LAF_VERBOSE 190 curl_share_setopt(ret.handle, CURLOPT_VERBOSE, 1); 191 191 #endif 192 192 … … 206 206 } 207 207 if(handle.handle) 208 curl_ easy_cleanup(handle.handle);208 curl_share_cleanup(handle.handle); 209 209 curl_global_cleanup(); 210 210 } … … 222 222 case INTERNET_FLAG_NO_CACHE_WRITE: 223 223 hInternet.hasCacheFile=-1; 224 curl_ easy_setopt(hInternet.handle, CURLOPT_WRITEFUNCTION, write_data_into);225 curl_ easy_setopt(hInternet.handle, CURLOPT_WRITEDATA, &hInternet);224 curl_share_setopt(hInternet.handle, CURLOPT_WRITEFUNCTION, write_data_into); 225 curl_share_setopt(hInternet.handle, CURLOPT_WRITEDATA, &hInternet); 226 226 break; 227 227 default: … … 236 236 237 237 hInternet.hasCacheFile=1; 238 curl_ easy_setopt(hInternet.handle, CURLOPT_WRITEFUNCTION, NULL);239 curl_ easy_setopt(hInternet.handle, CURLOPT_WRITEDATA, hInternet.file);238 curl_share_setopt(hInternet.handle, CURLOPT_WRITEFUNCTION, NULL); 239 curl_share_setopt(hInternet.handle, CURLOPT_WRITEDATA, hInternet.file); 240 240 hInternet.nDataLen=0; 241 241 break; … … 250 250 #endif 251 251 //curl_easy_setopt(hInternet.handle,CURLOPT_COOKIE,lpszHeaders); 252 curl_ easy_setopt(hInternet.handle,CURLOPT_POST,1);252 curl_share_setopt(hInternet.handle,CURLOPT_POST,1); 253 253 #ifdef ULINET_DEBUG 254 254 fprintf(stderr,"** (%s) %d **\n",lpszHeaders,dwHeadersLength); 255 curl_ easy_setopt(hInternet.handle,CURLOPT_VERBOSE,1);256 #endif 257 curl_ easy_setopt(hInternet.handle,CURLOPT_POSTFIELDS,lpszHeaders);255 curl_share_setopt(hInternet.handle,CURLOPT_VERBOSE,1); 256 #endif 257 curl_share_setopt(hInternet.handle,CURLOPT_POSTFIELDS,lpszHeaders); 258 258 //curl_easy_setopt(hInternet.handle,CURLOPT_POSTFIELDSIZE,dwHeadersLength+1); 259 259 if(hInternet.header!=NULL) 260 curl_ easy_setopt(hInternet.handle,CURLOPT_HTTPHEADER,hInternet.header);261 } 262 263 curl_ easy_setopt(hInternet.handle,CURLOPT_URL,lpszUrl);260 curl_share_setopt(hInternet.handle,CURLOPT_HTTPHEADER,hInternet.header); 261 } 262 263 curl_share_setopt(hInternet.handle,CURLOPT_URL,lpszUrl); 264 264 curl_easy_perform(hInternet.handle); 265 265 curl_easy_getinfo(hInternet.handle,CURLINFO_CONTENT_TYPE,&hInternet.mimeType); … … 273 273 memset(&CCookie[0],0,1024); 274 274 #ifndef TIGER 275 curl_ easy_setopt(hInternet.handle, CURLOPT_COOKIELIST, "ALL");275 curl_share_setopt(hInternet.handle, CURLOPT_COOKIELIST, "ALL"); 276 276 #endif 277 277 return 1;
Note: See TracChangeset
for help on using the changeset viewer.