Author: hbelusca Date: Sun Apr 21 23:39:05 2013 New Revision: 58823
URL: http://svn.reactos.org/svn/reactos?rev=58823&view=rev Log: [KDCOM] Seems to fix reconnection issues, in two lines.
Modified: trunk/reactos/drivers/base/kddll/kddll.c
Modified: trunk/reactos/drivers/base/kddll/kddll.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kddll/kddll.c?... ============================================================================== --- trunk/reactos/drivers/base/kddll/kddll.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kddll/kddll.c [iso-8859-1] Sun Apr 21 23:39:05 2013 @@ -371,6 +371,16 @@
do { + if (Retries == 0) + { + /* PACKET_TYPE_KD_DEBUG_IO is allowed to instantly timeout */ + if (PacketType == PACKET_TYPE_KD_DEBUG_IO) + { + /* No response, silently fail. */ + return; + } + } + /* Set the packet id */ Packet.PacketId = CurrentPacketId;
@@ -381,10 +391,7 @@ KdpSendBuffer(MessageHeader->Buffer, MessageHeader->Length);
/* If we have meesage data, also send it */ - if (MessageData) - { - KdpSendBuffer(MessageData->Buffer, MessageData->Length); - } + if (MessageData) KdpSendBuffer(MessageData->Buffer, MessageData->Length);
/* Finalize with a trailing byte */ KdpSendByte(PACKET_TRAILING_BYTE); @@ -393,31 +400,18 @@ KdStatus = KdReceivePacket(PACKET_TYPE_KD_ACKNOWLEDGE, NULL, NULL, - 0, + NULL, KdContext); - - /* Did we succeed? */ - if (KdStatus == KDP_PACKET_RECEIVED) - { - CurrentPacketId &= ~SYNC_PACKET_ID; - break; - } - - /* PACKET_TYPE_KD_DEBUG_IO is allowed to instantly timeout */ - if (PacketType == PACKET_TYPE_KD_DEBUG_IO) - { - /* No response, silently fail. */ - return; - } - if (KdStatus == KDP_PACKET_TIMEOUT) { - Retries--; + if (Retries > 0) Retries--; }
/* Packet timed out, send it again */ KDDBGPRINT("KdSendPacket got KdStatus 0x%x\n", KdStatus); - } - while (Retries > 0); -} - + + } while (KdStatus != KDP_PACKET_RECEIVED); + + CurrentPacketId &= ~SYNC_PACKET_ID; +} +