Skip to content

Commit

Permalink
Fix Send/Recv function calls re: default values.
Browse files Browse the repository at this point in the history
Default parameter values in SendPacket and ReceivePacket
were leading to confusion in the ReceivePit function.
Empty transfer flags were passed in as timeouts.

Additionally, on the GS5, empty transfers
aren't required around the send ack packets
during Pit retrieval, and actually screw up
the state breaking the remainder of
the session.
  • Loading branch information
sshimko committed Sep 3, 2014
1 parent 980c453 commit 99cdc27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions heimdall/source/BridgeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,9 @@ int BridgeManager::ReceivePitFile(unsigned char **pitBuffer) const
for (unsigned int i = 0; i < transferCount; i++)
{
DumpPartPitFilePacket *requestPacket = new DumpPartPitFilePacket(i);
success = SendPacket(requestPacket);
// The GS5 needs a None here or state gets screwed up.
// Do older models need After?
success = SendPacket(requestPacket, kDefaultTimeoutSend, kEmptyTransferNone);
delete requestPacket;

if (!success)
Expand All @@ -934,10 +936,11 @@ int BridgeManager::ReceivePitFile(unsigned char **pitBuffer) const
return (0);
}

// send empty transfer after the last expected received packet
int receiveEmptyTransferFlags = (i == transferCount - 1) ? kEmptyTransferAfter : kEmptyTransferNone;

ReceiveFilePartPacket *receiveFilePartPacket = new ReceiveFilePartPacket();
success = ReceivePacket(receiveFilePartPacket, receiveEmptyTransferFlags);
success = ReceivePacket(receiveFilePartPacket, kDefaultTimeoutReceive, receiveEmptyTransferFlags);

if (!success)
{
Expand Down

0 comments on commit 99cdc27

Please sign in to comment.