Drone now disconnects only if version is incompatible or if any other RPC is received before versionCheck() - for all other errors/failures, drone does not disconnect the connection with client

This commit is contained in:
Srivats P. 2014-07-06 11:26:26 +05:30
parent 9955d31b77
commit 57be4f3ada

View File

@ -219,6 +219,7 @@ void RpcConnection::on_clientSock_dataAvail()
::google::protobuf::Message *req, *resp;
PbRpcController *controller;
QString error;
bool disconnect = false;
// Do we have enough bytes for a msg header?
// If yes, peek into the header and get msg length
@ -260,6 +261,7 @@ void RpcConnection::on_clientSock_dataAvail()
qDebug("server(%s): version compatibility check pending",
__FUNCTION__);
error = "version compatibility check pending";
disconnect = true;
goto _error_exit;
}
@ -347,6 +349,7 @@ _error_exit2:
isPending = true;
controller = new PbRpcController(NULL, NULL);
controller->SetFailed(error);
if (disconnect)
controller->TriggerDisconnect();
sendRpcReply(controller);
return;