From d554070fc38dacc6404ed6cd46bea02e9f17b6e2 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sun, 8 Nov 2009 15:59:18 +0000 Subject: [PATCH] Move up ConnectToPeer --- Src/Network.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Src/Network.cpp b/Src/Network.cpp index 03e6495..828d484 100644 --- a/Src/Network.cpp +++ b/Src/Network.cpp @@ -1217,6 +1217,7 @@ network_connection_error_t Network::ConnectFSM() * 5. Until connected: * 5.1 Send connection message to peer * 5.2 Wait for reply from peer + * 6. Test bandwidth */ switch(this->network_connection_state) { @@ -1252,14 +1253,14 @@ network_connection_error_t Network::ConnectFSM() return AGAIN_ERROR; /* Allow some transit time */ sleep(1); + if (this->ConnectToPeer() == false) + return AGAIN_ERROR; this->network_connection_state = CONN_WAIT_FOR_PEER_REPLY; break; case CONN_WAIT_FOR_PEER_REPLY: /* Connect again in case the first sent was dropped on * its way to the peer */ TheC64->TheDisplay->display_status_string((char*)"CONNECTING TO PEER", 1); - if (this->ConnectToPeer() == false) - return AGAIN_ERROR; if (this->WaitForPeerReply() == true) this->network_connection_state = CONN_BANDWIDTH_PING; else