Hans Leidekker : rpcrt4: Make sure the Content-Length header is set correctly when preparing the out pipe.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Dec 19 16:18:34 CST 2014


Module: wine
Branch: master
Commit: 49a2fb660be589f5bdbd3c2e71fb7f48d8f37836
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=49a2fb660be589f5bdbd3c2e71fb7f48d8f37836

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Fri Dec 19 17:06:19 2014 +0100

rpcrt4: Make sure the Content-Length header is set correctly when preparing the out pipe.

---

 dlls/rpcrt4/rpc_transport.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
index c5ed04d..3016d83 100644
--- a/dlls/rpcrt4/rpc_transport.c
+++ b/dlls/rpcrt4/rpc_transport.c
@@ -2321,14 +2321,17 @@ static RPC_STATUS rpcrt4_http_prepare_out_pipe(HINTERNET out_request, RpcHttpAsy
                                                const UUID *out_pipe_uuid, ULONG *flow_control_increment,
                                                BOOL authorized)
 {
+    static const WCHAR fmtW[] =
+        {'C','o','n','t','e','n','t','-','L','e','n','g','t','h',':',' ','%','u','\r','\n',0};
     BOOL ret;
     RPC_STATUS status;
     RpcPktHdr *hdr;
     BYTE *data_from_server;
     RpcPktHdr pkt_from_server;
     ULONG field1, field3;
-    DWORD bytes_read;
+    DWORD bytes_read, len;
     BYTE buf[20];
+    WCHAR header[sizeof(fmtW) / sizeof(fmtW[0]) + 10];
 
     if (!authorized)
     {
@@ -2344,7 +2347,8 @@ static RPC_STATUS rpcrt4_http_prepare_out_pipe(HINTERNET out_request, RpcHttpAsy
 
     TRACE("sending HTTP connect header to server\n");
     prepare_async_request(async_data);
-    ret = HttpSendRequestW(out_request, NULL, 0, hdr, hdr->common.frag_len);
+    len = sprintfW(header, fmtW, hdr->common.frag_len);
+    ret = HttpSendRequestW(out_request, header, len, hdr, hdr->common.frag_len);
     status = wait_async_request(async_data, ret, cancel_event);
     RPCRT4_FreeHeader(hdr);
     if (status != RPC_S_OK) return status;




More information about the wine-cvs mailing list