Hans Leidekker : winhttp: Resend any request data when handling an authentication or redirect response .
Alexandre Julliard
julliard at winehq.org
Tue Apr 30 12:51:27 CDT 2013
Module: wine
Branch: master
Commit: d63ef4d855654a60ebc8b8660cf161ee837db46e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d63ef4d855654a60ebc8b8660cf161ee837db46e
Author: Hans Leidekker <hans at codeweavers.com>
Date: Tue Apr 30 11:32:31 2013 +0200
winhttp: Resend any request data when handling an authentication or redirect response.
---
dlls/winhttp/request.c | 18 +++++++++++++-----
dlls/winhttp/winhttp_private.h | 2 ++
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index bab576e..8d579b3 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -1124,9 +1124,13 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len
heap_free( req_ascii );
if (!ret) goto end;
- if (optional_len && !netconn_send( &request->netconn, optional, optional_len, 0, &bytes_sent )) goto end;
- len += optional_len;
-
+ if (optional_len)
+ {
+ if (!netconn_send( &request->netconn, optional, optional_len, 0, &bytes_sent )) goto end;
+ request->optional = optional;
+ request->optional_len = optional_len;
+ len += optional_len;
+ }
send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, &len, sizeof(DWORD) );
end:
@@ -1951,6 +1955,8 @@ static BOOL handle_redirect( request_t *request, DWORD status )
{
heap_free( request->verb );
request->verb = strdupW( getW );
+ request->optional = NULL;
+ request->optional_len = 0;
}
ret = TRUE;
@@ -1987,7 +1993,8 @@ static BOOL receive_response( request_t *request, BOOL async )
if (!(ret = handle_redirect( request, status ))) break;
- send_request( request, NULL, 0, NULL, 0, 0, 0, FALSE ); /* recurse synchronously */
+ /* recurse synchronously */
+ send_request( request, NULL, 0, request->optional, request->optional_len, 0, 0, FALSE );
continue;
}
else if (status == HTTP_STATUS_DENIED || status == HTTP_STATUS_PROXY_AUTH_REQ)
@@ -2000,7 +2007,8 @@ static BOOL receive_response( request_t *request, BOOL async )
ret = TRUE;
break;
}
- send_request( request, NULL, 0, NULL, 0, 0, 0, FALSE );
+ /* recurse synchronously */
+ send_request( request, NULL, 0, request->optional, request->optional_len, 0, 0, FALSE );
continue;
}
break;
diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h
index 82b4582..d47bed3 100644
--- a/dlls/winhttp/winhttp_private.h
+++ b/dlls/winhttp/winhttp_private.h
@@ -156,6 +156,8 @@ typedef struct
LPWSTR path;
LPWSTR version;
LPWSTR raw_headers;
+ void *optional;
+ DWORD optional_len;
netconn_t netconn;
int resolve_timeout;
int connect_timeout;
More information about the wine-cvs
mailing list