From 407daec822441dcf44cad18b497f42266100fe3a Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Mon, 26 Dec 2011 20:11:19 +0100 Subject: [PATCH] connection::actions(): Do not require tick prefix during negotiation --- connection.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/connection.cc b/connection.cc index d4def07..597e51c 100644 --- a/connection.cc +++ b/connection.cc @@ -113,14 +113,17 @@ connection::actions(int tick_id, class agent *agent) int nlofs = in_buf.find("\r\n"); std::string line = in_buf.substr(0, nlofs); in_buf.erase(0, nlofs + 2); + int spofs; - int spofs = line.find(' '); - std::string cmd_tick_id = line.substr(0, spofs); - line.erase(0, spofs + 1); + if (!negotiation) { + spofs = line.find(' '); + std::string cmd_tick_id = line.substr(0, spofs); + line.erase(0, spofs + 1); - if (atol(cmd_tick_id.c_str()) != tick_id - 1) { - /* Out of sync command, ignore and continue. */ - continue; + if (atol(cmd_tick_id.c_str()) != tick_id - 1) { + /* Out of sync command, ignore and continue. */ + continue; + } } spofs = line.find(' ');