From 164ddbca8c232470c825a0b75e183cef5250490a Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Thu, 21 Feb 2013 10:47:45 +0100 Subject: [PATCH] rpcrt4: Accept HTTP idle packets while waiting for the second prepare header. --- dlls/rpcrt4/rpc_transport.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index 54f0faa8a20..e3e428b10d2 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -2324,9 +2324,22 @@ static RPC_STATUS rpcrt4_http_prepare_out_pipe(HINTERNET out_request, if (status != RPC_S_OK) return status; TRACE("received (%d) from first prepare header\n", field1); - status = rpcrt4_http_read_http_packet(out_request, &pkt_from_server, - &data_from_server); - if (status != RPC_S_OK) return status; + for (;;) + { + status = rpcrt4_http_read_http_packet(out_request, &pkt_from_server, + &data_from_server); + if (status != RPC_S_OK) return status; + if (pkt_from_server.http.flags != 0x0001) break; + + TRACE("http idle packet, waiting for real packet\n"); + HeapFree(GetProcessHeap(), 0, data_from_server); + if (pkt_from_server.http.num_data_items != 0) + { + ERR("HTTP idle packet should have no data items instead of %d\n", + pkt_from_server.http.num_data_items); + return RPC_S_PROTOCOL_ERROR; + } + } status = RPCRT4_ParseHttpPrepareHeader2(&pkt_from_server, data_from_server, &field1, flow_control_increment, &field3);