Commit f7e56d19 authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

wininet: Remove redundant CrLf variables.

parent bc9e214f
...@@ -74,6 +74,7 @@ static const WCHAR szProxy_Authorization[] = { 'P','r','o','x','y','-','A','u',' ...@@ -74,6 +74,7 @@ static const WCHAR szProxy_Authorization[] = { 'P','r','o','x','y','-','A','u','
static const WCHAR szStatus[] = { 'S','t','a','t','u','s',0 }; static const WCHAR szStatus[] = { 'S','t','a','t','u','s',0 };
static const WCHAR szKeepAlive[] = {'K','e','e','p','-','A','l','i','v','e',0}; static const WCHAR szKeepAlive[] = {'K','e','e','p','-','A','l','i','v','e',0};
static const WCHAR szGET[] = { 'G','E','T', 0 }; static const WCHAR szGET[] = { 'G','E','T', 0 };
static const WCHAR szCrLf[] = {'\r','\n', 0};
#define MAXHOSTNAME 100 #define MAXHOSTNAME 100
#define MAX_FIELD_VALUE_LEN 256 #define MAX_FIELD_VALUE_LEN 256
...@@ -256,7 +257,6 @@ static LPWSTR HTTP_BuildHeaderRequestString( LPWININETHTTPREQW lpwhr, LPCWSTR ve ...@@ -256,7 +257,6 @@ static LPWSTR HTTP_BuildHeaderRequestString( LPWININETHTTPREQW lpwhr, LPCWSTR ve
LPWSTR p; LPWSTR p;
static const WCHAR szSpace[] = { ' ',0 }; static const WCHAR szSpace[] = { ' ',0 };
static const WCHAR szcrlf[] = {'\r','\n', 0};
static const WCHAR szColon[] = { ':',' ',0 }; static const WCHAR szColon[] = { ':',' ',0 };
static const WCHAR sztwocrlf[] = {'\r','\n','\r','\n', 0}; static const WCHAR sztwocrlf[] = {'\r','\n','\r','\n', 0};
...@@ -277,7 +277,7 @@ static LPWSTR HTTP_BuildHeaderRequestString( LPWININETHTTPREQW lpwhr, LPCWSTR ve ...@@ -277,7 +277,7 @@ static LPWSTR HTTP_BuildHeaderRequestString( LPWININETHTTPREQW lpwhr, LPCWSTR ve
{ {
if (lpwhr->pCustHeaders[i].wFlags & HDR_ISREQUEST) if (lpwhr->pCustHeaders[i].wFlags & HDR_ISREQUEST)
{ {
req[n++] = szcrlf; req[n++] = szCrLf;
req[n++] = lpwhr->pCustHeaders[i].lpszField; req[n++] = lpwhr->pCustHeaders[i].lpszField;
req[n++] = szColon; req[n++] = szColon;
req[n++] = lpwhr->pCustHeaders[i].lpszValue; req[n++] = lpwhr->pCustHeaders[i].lpszValue;
...@@ -2189,7 +2189,6 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev ...@@ -2189,7 +2189,6 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
LPWSTR headers; LPWSTR headers;
DWORD len = 0; DWORD len = 0;
BOOL ret = FALSE; BOOL ret = FALSE;
static const WCHAR CRLF[] = {'\r','\n',0};
if (request_only) if (request_only)
headers = HTTP_BuildHeaderRequestString(lpwhr, lpwhr->lpszVerb, lpwhr->lpszPath, lpwhr->lpszVersion); headers = HTTP_BuildHeaderRequestString(lpwhr, lpwhr->lpszVerb, lpwhr->lpszPath, lpwhr->lpszVersion);
...@@ -2211,8 +2210,8 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev ...@@ -2211,8 +2210,8 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
memcpy(lpBuffer, headers, len + sizeof(WCHAR)); memcpy(lpBuffer, headers, len + sizeof(WCHAR));
else else
{ {
len = strlenW(CRLF) * sizeof(WCHAR); len = strlenW(szCrLf) * sizeof(WCHAR);
memcpy(lpBuffer, CRLF, sizeof(CRLF)); memcpy(lpBuffer, szCrLf, sizeof(szCrLf));
} }
TRACE("returning data: %s\n", debugstr_wn(lpBuffer, len / sizeof(WCHAR))); TRACE("returning data: %s\n", debugstr_wn(lpBuffer, len / sizeof(WCHAR)));
ret = TRUE; ret = TRUE;
...@@ -2225,7 +2224,6 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev ...@@ -2225,7 +2224,6 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
} }
case HTTP_QUERY_RAW_HEADERS: case HTTP_QUERY_RAW_HEADERS:
{ {
static const WCHAR szCrLf[] = {'\r','\n',0};
LPWSTR * ppszRawHeaderLines = HTTP_Tokenize(lpwhr->lpszRawHeaders, szCrLf); LPWSTR * ppszRawHeaderLines = HTTP_Tokenize(lpwhr->lpszRawHeaders, szCrLf);
DWORD i, size = 0; DWORD i, size = 0;
LPWSTR pszString = (WCHAR*)lpBuffer; LPWSTR pszString = (WCHAR*)lpBuffer;
...@@ -3145,14 +3143,13 @@ static void HTTP_InsertCookies(LPWININETHTTPREQW lpwhr) ...@@ -3145,14 +3143,13 @@ static void HTTP_InsertCookies(LPWININETHTTPREQW lpwhr)
{ {
int cnt = 0; int cnt = 0;
static const WCHAR szCookie[] = {'C','o','o','k','i','e',':',' ',0}; static const WCHAR szCookie[] = {'C','o','o','k','i','e',':',' ',0};
static const WCHAR szcrlf[] = {'\r','\n',0};
size = sizeof(szCookie) + nCookieSize * sizeof(WCHAR) + sizeof(szcrlf); size = sizeof(szCookie) + nCookieSize * sizeof(WCHAR) + sizeof(szCrLf);
if ((lpszCookies = HeapAlloc(GetProcessHeap(), 0, size))) if ((lpszCookies = HeapAlloc(GetProcessHeap(), 0, size)))
{ {
cnt += sprintfW(lpszCookies, szCookie); cnt += sprintfW(lpszCookies, szCookie);
InternetGetCookieW(lpszUrl, NULL, lpszCookies + cnt, &nCookieSize); InternetGetCookieW(lpszUrl, NULL, lpszCookies + cnt, &nCookieSize);
strcatW(lpszCookies, szcrlf); strcatW(lpszCookies, szCrLf);
HTTP_HttpAddRequestHeadersW(lpwhr, lpszCookies, strlenW(lpszCookies), HTTP_ADDREQ_FLAG_ADD); HTTP_HttpAddRequestHeadersW(lpwhr, lpszCookies, strlenW(lpszCookies), HTTP_ADDREQ_FLAG_ADD);
HeapFree(GetProcessHeap(), 0, lpszCookies); HeapFree(GetProcessHeap(), 0, lpszCookies);
...@@ -3722,7 +3719,6 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear) ...@@ -3722,7 +3719,6 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear)
DWORD buflen = MAX_REPLY_LEN; DWORD buflen = MAX_REPLY_LEN;
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
INT rc = 0; INT rc = 0;
static const WCHAR szCrLf[] = {'\r','\n',0};
static const WCHAR szHundred[] = {'1','0','0',0}; static const WCHAR szHundred[] = {'1','0','0',0};
char bufferA[MAX_REPLY_LEN]; char bufferA[MAX_REPLY_LEN];
LPWSTR status_code, status_text; LPWSTR status_code, status_text;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment