From cabf8905526b6601813573d049f6afaf364e1cac Mon Sep 17 00:00:00 2001 From: Kraant Date: Sun, 10 Aug 2008 13:00:33 +0000 Subject: Changed proxy fix to only tell the proxy to no-cache for news.txt and resources2.txt. (cherry picked from Aethyra commit 3206b3254a1a9b90bbdbd1a7178e4df043a5ee26) --- src/gui/updatewindow.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index d453e22a..2edb1a9a 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -310,12 +310,15 @@ int UpdaterWindow::downloadThread(void *ptr) curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 15); - /*caching breaks things when resources2.txt is cached - *so caching is turned off on the proxy with this header - *change*/ struct curl_slist *pHeaders=NULL; - pHeaders = curl_slist_append(pHeaders, "pragma: no-cache"); - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, pHeaders); + if(uw->mDownloadStatus != UPDATE_RESOURCES){ + /*caching breaks things when resources2.txt is cached + *so caching is turned off on the proxy with this header + *change*/ + pHeaders = curl_slist_append(pHeaders, "pragma: no-cache"); + pHeaders = curl_slist_append(pHeaders, "Cache-Control: no-cache"); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, pHeaders); + } if ((res = curl_easy_perform(curl)) != 0) { @@ -341,7 +344,9 @@ int UpdaterWindow::downloadThread(void *ptr) curl_easy_cleanup(curl); - curl_slist_free_all(pHeaders); + if(uw->mDownloadStatus != UPDATE_RESOURCES){ + curl_slist_free_all(pHeaders); + } if (!uw->mStoreInMemory) { -- cgit v1.2.3-70-g09d2