diff options
author | Kraant <kraant@gmail.com> | 2008-08-10 10:56:58 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-12-07 00:52:14 +0100 |
commit | 047f598be826dd57dd1124db914e8367256112be (patch) | |
tree | 8c2d0743136d07d83c4a044ebdbf4c612f6bedf3 | |
parent | ad8b5f6389562a1f68f2821753317ea7c22bf2ea (diff) | |
download | mana-047f598be826dd57dd1124db914e8367256112be.tar.gz mana-047f598be826dd57dd1124db914e8367256112be.tar.bz2 mana-047f598be826dd57dd1124db914e8367256112be.tar.xz mana-047f598be826dd57dd1124db914e8367256112be.zip |
Set headers for CURL so that proxies won't cache files
to fix bug that causes resources2.txt to be old and
out of sync with the files in the directory.
(cherry picked from Aethyra commit ccacde4192268fbf5250e9bd6894d158f957922c)
-rw-r--r-- | src/gui/updatewindow.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index c0344b72..d453e22a 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -310,6 +310,13 @@ 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 ((res = curl_easy_perform(curl)) != 0) { uw->mDownloadStatus = UPDATE_ERROR; @@ -334,6 +341,8 @@ int UpdaterWindow::downloadThread(void *ptr) curl_easy_cleanup(curl); + curl_slist_free_all(pHeaders); + if (!uw->mStoreInMemory) { // Don't check resources2.txt checksum |