Changeset 18987


Ignore:
Timestamp:
Aug 2, 2006, 12:32:02 AM (14 years ago)
Author:
pguyot (Paul Guyot)
Message:

Avoid sending the pragma no cache header when fetching files with libcurl.

Bug: #8669
Submitted by: josh_root@, blb@
Reviewed by:
Approved by:
Obtained from:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/pextlib1.0/curl.c

    r17196 r18987  
    11/*
    22 * curl.c
    3  * $Id: curl.c,v 1.10 2006/03/27 21:27:02 jberry Exp $
     3 * $Id: curl.c,v 1.11 2006/08/02 00:32:02 pguyot Exp $
    44 *
    55 * Copyright (c) 2005 Paul Guyot, Darwinports Team.
     
    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 */
     
    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);
     
    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) {
Note: See TracChangeset for help on using the changeset viewer.