Changeset 38926


Ignore:
Timestamp:
09/21/16 12:24:21 (7 years ago)
Author:
obi
Message:

tithek fix vivo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/tithek/tithek_global.h

    r38825 r38926  
    180180                        curl_easy_setopt(curl_handle, CURLOPT_POST, 1);
    181181                        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);
    182186                }
    183187                if(flag == 1)
    184188                        curl_easy_setopt(curl_handle, CURLOPT_HEADER, 1L);
    185189                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
    187193                /* send all data to this function  */
    188194            if(localfile == NULL)
     
    198204
    199205                /* 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");
    202208
    203209                // This is occassionally required to stop CURL from verifying the peers certificate.
     
    216222                curl_easy_setopt(curl_handle, CURLOPT_COOKIEFILE, "/mnt/network/cookies");
    217223                curl_easy_setopt(curl_handle, CURLOPT_COOKIEJAR, "/mnt/network/cookies");
     224                /* enable redirect following */
    218225                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 
    219232                if(referer == NULL)
    220233                        curl_easy_setopt(curl_handle, CURLOPT_AUTOREFERER, 1L);
Note: See TracChangeset for help on using the changeset viewer.