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