git-svn-id: svn://db.shs.com.ru/pip@408 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -62,6 +62,7 @@ void PIBaseTransfer::received(PIByteArray data) {
|
||||
data >> h;
|
||||
PacketType pt = (PacketType)h.type;
|
||||
if (!h.check_sig()) {
|
||||
piCoutObj << "invalid packet signature";
|
||||
diag.received(data.size(), false);
|
||||
return;
|
||||
} else diag.received(data.size(), true);
|
||||
@@ -79,8 +80,8 @@ void PIBaseTransfer::received(PIByteArray data) {
|
||||
uint ccrc = crc.calculate(data.data(), data.size_s());
|
||||
if (rcrc != ccrc) {
|
||||
header.id = h.id;
|
||||
sendReply(pt_ReplyInvalid);
|
||||
piCoutObj << "invalid CRC";
|
||||
sendReply(pt_ReplyInvalid);
|
||||
} else {
|
||||
mutex_session.lock();
|
||||
processData(h.id, data);
|
||||
@@ -110,6 +111,8 @@ void PIBaseTransfer::received(PIByteArray data) {
|
||||
mutex_session.lock();
|
||||
if (h.id < replies.size())
|
||||
replies[h.id] = pt;
|
||||
else
|
||||
piCoutObj << "invalid reply id";
|
||||
mutex_session.unlock();
|
||||
// piCoutObj << "Done Packet" << h.id;
|
||||
}
|
||||
@@ -419,7 +422,7 @@ void PIBaseTransfer::sendBreak(int session_id) {
|
||||
|
||||
|
||||
void PIBaseTransfer::sendReply(PacketType reply) {
|
||||
//piCoutObj << "sendReply" << reply;
|
||||
piCoutObj << "sendReply" << reply;
|
||||
header.type = reply;
|
||||
PIByteArray ba;
|
||||
ba << header;
|
||||
|
||||
Reference in New Issue
Block a user