aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2004-12-06 04:00:03 +0000
committerJason Woodward2004-12-06 04:00:03 +0000
commit09b72defcfe47ed8a1b7fc93f1706e54ef9437e6 (patch)
tree7025e27c68aebd0e8d8b4797471f4ee862de4e14
parent594c53e8583ecc8dac71b0c30fd3dc72bff727aa (diff)
downloadslapt-get-09b72defcfe47ed8a1b7fc93f1706e54ef9437e6.tar.gz
disabled default header of "Pragma: no-cache" for users behind web proxy
-rw-r--r--ChangeLog3
-rw-r--r--src/curl.c9
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c603689..51f4b4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
-0.9.9e Dec 01, 2004
+0.9.9e Dec 05, 2004
+ * disabled default header of "Pragma: no-cache" for users behind web proxy
* fixed pt_PT translation, missing \n
* --upgrade now checks to see if there is multiple installed packages and
uses the newest one
diff --git a/src/curl.c b/src/curl.c
index f5db6da..0bdc8d2 100644
--- a/src/curl.c
+++ b/src/curl.c
@@ -24,6 +24,7 @@ int download_data(FILE *fh,const char *url,size_t bytes,int use_curl_dl_stats){
CURLcode response;
char curl_err_buff[1024];
int return_code = 0;
+ struct curl_slist *headers = NULL;
#if DEBUG == 1
printf(_("Fetching url:[%s]\n"),url);
@@ -39,6 +40,8 @@ int download_data(FILE *fh,const char *url,size_t bytes,int use_curl_dl_stats){
#endif
curl_easy_setopt(ch, CURLOPT_FAILONERROR, 1);
+ headers = curl_slist_append(headers, "Pragma: "); /* override no-cache */
+
if( use_curl_dl_stats != 1 ){
curl_easy_setopt(ch, CURLOPT_PROGRESSFUNCTION, progress_callback );
curl_easy_setopt(ch, CURLOPT_PROGRESSDATA, &bytes);
@@ -72,6 +75,7 @@ int download_data(FILE *fh,const char *url,size_t bytes,int use_curl_dl_stats){
curl_easy_cleanup(ch);
/* can't do a curl_free() after curl_easy_cleanup() */
/* curl_free(ch); */
+ curl_slist_free_all(headers);
return return_code;
}
@@ -96,6 +100,7 @@ char *head_request(const char *url){
CURL *ch = NULL;
CURLcode response;
struct head_data_t head_t;
+ struct curl_slist *headers = NULL;
head_t.data = malloc( sizeof *head_t.data );
head_t.size = 0;
@@ -114,13 +119,17 @@ char *head_request(const char *url){
#endif
curl_easy_setopt(ch, CURLOPT_FAILONERROR, 1);
+ headers = curl_slist_append(headers, "Pragma: "); /* override no-cache */
+
if( (response = curl_easy_perform(ch)) != 0 ){
free(head_t.data);
curl_easy_cleanup(ch);
+ curl_slist_free_all(headers);
return NULL;
}
curl_easy_cleanup(ch);
+ curl_slist_free_all(headers);
return head_t.data;
}