[try2] [1/2] wininet: Add support of INTERNET_FLAG_NO_CACHE_WRITE

Alexander Morozov amorozov at etersoft.ru
Fri Jul 4 05:14:59 CDT 2008


Add "Cache-Contol: no-cache" to HTTP header if HttpOpenRequest is called 
with "POST" and INTERNET_FLAG_NO_CACHE_WRITE

Patch [2/2] is not changed.
-------------- next part --------------
From f945f589e56834f7f0ddda79d7628a46adebb227 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov at etersoft.ru>
Date: Fri, 4 Jul 2008 14:00:29 +0400
Subject: [PATCH] wininet: Add support of INTERNET_FLAG_NO_CACHE_WRITE

---
 dlls/wininet/http.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 970e502..8171838 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -3181,6 +3181,12 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
         static const WCHAR pragma_nocache[] = {'P','r','a','g','m','a',':',' ','n','o','-','c','a','c','h','e','\r','\n',0};
         HTTP_HttpAddRequestHeadersW(lpwhr, pragma_nocache, strlenW(pragma_nocache), HTTP_ADDREQ_FLAG_ADD_IF_NEW);
     }
+    if ((lpwhr->hdr.dwFlags & INTERNET_FLAG_NO_CACHE_WRITE) && !strcmpW(lpwhr->lpszVerb, szPost))
+    {
+        static const WCHAR cache_control[] = {'C','a','c','h','e','-','C','o','n','t','r','o','l',':',
+                                              ' ','n','o','-','c','a','c','h','e','\r','\n',0};
+        HTTP_HttpAddRequestHeadersW(lpwhr, cache_control, strlenW(cache_control), HTTP_ADDREQ_FLAG_ADD_IF_NEW);
+    }
 
     do
     {
-- 
1.5.4.5.GIT



More information about the wine-patches mailing list