From: Marc-André Moreau Date: Tue, 27 Nov 2012 09:05:41 +0000 (-0500) Subject: libfreerdp-core: attempt TsProxyCreateTunnelReadResponse fix X-Git-Tag: 1.1.0-beta1~143^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf5d55d3cf3dc288552066a7e17f4bf12e221ec8;p=platform%2Fupstream%2Ffreerdp.git libfreerdp-core: attempt TsProxyCreateTunnelReadResponse fix --- diff --git a/client/X11/xfreerdp.c b/client/X11/xfreerdp.c index 1ac7c40..7f9a59c 100644 --- a/client/X11/xfreerdp.c +++ b/client/X11/xfreerdp.c @@ -1098,12 +1098,13 @@ int xfreerdp_run(freerdp* instance) if (max_fds == 0) break; - timeout.tv_sec = 5; + timeout.tv_sec = 1; + timeout.tv_usec = 0; + select_status = select(max_fds + 1, &rfds_set, &wfds_set, NULL, &timeout); if (select_status == 0) { - //freerdp_send_keep_alive(instance); continue; } else if (select_status == -1) diff --git a/libfreerdp/core/rts.c b/libfreerdp/core/rts.c index fd15682..5ccaeed 100644 --- a/libfreerdp/core/rts.c +++ b/libfreerdp/core/rts.c @@ -902,6 +902,9 @@ int rts_recv_flow_control_ack_with_destination_pdu(rdpRpc* rpc, BYTE* buffer, UI Destination, BytesReceived, AvailableWindow); printf("ChannelCookie: " RPC_UUID_FORMAT_STRING "\n", RPC_UUID_FORMAT_ARGUMENTS(ChannelCookie)); + rpc->VirtualConnection->DefaultInChannel->SenderAvailableWindow = + AvailableWindow - (rpc->VirtualConnection->DefaultInChannel->BytesSent - BytesReceived); + return 0; } diff --git a/libfreerdp/core/tsg.c b/libfreerdp/core/tsg.c index c6ccb30..275327c 100644 --- a/libfreerdp/core/tsg.c +++ b/libfreerdp/core/tsg.c @@ -268,6 +268,8 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg) ZeroMemory(packetCapsResponse, sizeof(TSG_PACKET_CAPS_RESPONSE)); packet->tsgPacket.packetCapsResponse = packetCapsResponse; + printf("TSG_PACKET_TYPE_CAPS_RESPONSE\n"); + /* PacketQuarResponsePtr (4 bytes) */ packetCapsResponse->pktQuarEncResponse.flags = *((UINT32*) &buffer[offset + 12]); /* Flags */ packetCapsResponse->pktQuarEncResponse.certChainLen = *((UINT32*) &buffer[offset + 16]); /* CertChainLength */ @@ -297,15 +299,18 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg) count = *((UINT32*) &buffer[offset]); /* ActualCount (4 bytes) */ offset += 4; - printf("CertChain (%d)\n", ((count + 1) * 2)); - freerdp_hexdump(&buffer[offset], ((count + 1) * 2)); + printf("CertChain (%d)\n", (count * 2)); + freerdp_hexdump(&buffer[offset], (count * 2)); /* * CertChainData is a wide character string, and the count is * given in characters excluding the null terminator, therefore: * size = ((count + 1) * 2) */ - offset += ((count + 1) * 2); /* CertChainData */ + offset += (count * 2); /* CertChainData */ + + /* 4-byte alignment */ + rpc_offset_align(&offset, 4); } else { @@ -384,6 +389,8 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg) ZeroMemory(packetQuarEncResponse, sizeof(TSG_PACKET_QUARENC_RESPONSE)); packet->tsgPacket.packetQuarEncResponse = packetQuarEncResponse; + printf("TSG_PACKET_TYPE_QUARENC_RESPONSE\n"); + /* PacketQuarResponsePtr (4 bytes) */ packetQuarEncResponse->flags = *((UINT32*) &buffer[offset + 12]); /* Flags */ packetQuarEncResponse->certChainLen = *((UINT32*) &buffer[offset + 16]); /* CertChainLength */ @@ -401,15 +408,18 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg) count = *((UINT32*) &buffer[offset]); /* ActualCount (4 bytes) */ offset += 4; - printf("CertChain (%d)\n", ((count + 1) * 2)); - freerdp_hexdump(&buffer[offset], ((count + 1) * 2)); + printf("CertChain (%d)\n", (count * 2)); + freerdp_hexdump(&buffer[offset], (count * 2)); /* * CertChainData is a wide character string, and the count is * given in characters excluding the null terminator, therefore: * size = ((count + 1) * 2) */ - offset += ((count + 1) * 2); /* CertChainData */ + offset += (count * 2); /* CertChainData */ + + /* 4-byte alignment */ + rpc_offset_align(&offset, 4); } else {