Changeset 38926
- Timestamp:
- 09/21/16 12:24:21 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/tithek_global.h
r38825 r38926 180 180 curl_easy_setopt(curl_handle, CURLOPT_POST, 1); 181 181 curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, data); 182 183 /* example.com is redirected, so we tell libcurl to send POST on 301, 302 and 184 303 HTTP response codes */ 185 curl_easy_setopt(curl_handle, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL); 182 186 } 183 187 if(flag == 1) 184 188 curl_easy_setopt(curl_handle, CURLOPT_HEADER, 1L); 185 189 curl_easy_setopt(curl_handle, CURLOPT_CONNECTTIMEOUT, 5); 186 curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, 20); 190 curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, 3); 191 // curl_easy_setopt(curl_handle, CURLOPT_RETURNTRANSFER, 1); 192 187 193 /* send all data to this function */ 188 194 if(localfile == NULL) … … 198 204 199 205 /* some servers don't like requests that are made without a user-agent field, so we provide one */ 200 curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0");201 //curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.7.3000 Chrome/30.0.1599.101 Safari/537.36");206 // curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0"); 207 curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.7.3000 Chrome/30.0.1599.101 Safari/537.36"); 202 208 203 209 // This is occassionally required to stop CURL from verifying the peers certificate. … … 216 222 curl_easy_setopt(curl_handle, CURLOPT_COOKIEFILE, "/mnt/network/cookies"); 217 223 curl_easy_setopt(curl_handle, CURLOPT_COOKIEJAR, "/mnt/network/cookies"); 224 /* enable redirect following */ 218 225 curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L); 226 /* allow three redirects */ 227 curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L); 228 229 /* enable all supported built-in compressions */ 230 curl_easy_setopt(curl_handle, CURLOPT_ACCEPT_ENCODING, ""); 231 219 232 if(referer == NULL) 220 233 curl_easy_setopt(curl_handle, CURLOPT_AUTOREFERER, 1L);
Note: See TracChangeset
for help on using the changeset viewer.