Ticket #8669: curl.c.diff

File curl.c.diff, 1.2 KB (added by blb@…, 18 years ago)

Patch to base

  • base/src/pextlib1.0/curl.c

    old new  
    149149                const char* theURL;
    150150                const char* theFilePath;
    151151                CURLcode theCurlCode;
     152                struct curl_slist *headers = NULL;
    152153               
    153154                /* we might have options and then the url and the file */
    154155                /* let's process the options first */
     
    280281                        }
    281282                }
    282283
     284                /* Clear the Pragma: no-cache header */
     285                headers = curl_slist_append(headers, "Pragma:");
     286                theCurlCode = curl_easy_setopt(theHandle, CURLOPT_HTTPHEADER, headers);
     287                if (theCurlCode != CURLE_OK) {
     288                        theResult = SetResultFromCurlErrorCode(interp, theCurlCode);
     289                        break;
     290                }
     291
    283292                /* actually fetch the resource */
    284293                theCurlCode = curl_easy_perform(theHandle);
    285294                if (theCurlCode != CURLE_OK) {
     
    291300                (void) fclose( theFile );
    292301                theFile = NULL;
    293302               
     303                /* free header memory */
     304                curl_slist_free_all(headers);
     305
    294306                /* If --effective-url option was given, set given variable name to last effective url used by curl */
    295307                if (effectiveURLVarName != NULL) {
    296308                        theCurlCode = curl_easy_getinfo(theHandle, CURLINFO_EFFECTIVE_URL, &effectiveURL);