From 3116b1d0a34fc84cfd721373622b2b940cfd165e Mon Sep 17 00:00:00 2001 From: me_desk Date: Mon, 24 Sep 2012 20:39:23 +0000 Subject: log warnings about incompatible protocol versions git-svn-id: svn://localhost/project_picapica/trunk@208 fb96df88-216d-11de-830c-f3023f12d8ac --- PICA_node.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'PICA_node.c') diff --git a/PICA_node.c b/PICA_node.c index 3f752e7..f55534e 100755 --- a/PICA_node.c +++ b/PICA_node.c @@ -170,6 +170,16 @@ else { //// PICA_PROTO_VERDIFFER send(nc->sck,msg_VERDIFFER,msg_VERDIFFER_len,0); + + if (buf[2] > PICA_PROTO_VER_HIGH || (buf[2] == PICA_PROTO_VER_HIGH && buf[3] > PICA_PROTO_VER_LOW)) + { + PICA_warn("Client has newer protocol version than node. Please check if update for pica-node is available"); + } + else + { + PICA_info("Client has older protocol version. Disconnecting ..."); + } + return 0; } @@ -277,6 +287,17 @@ else { //// PICA_PROTO_VERDIFFER send(nc->sck,msg_VERDIFFER,msg_VERDIFFER_len,0); + + if (buf[2] > PICA_PROTO_VER_HIGH || (buf[2] == PICA_PROTO_VER_HIGH && buf[3] > PICA_PROTO_VER_LOW)) + { + PICA_warn("Node %s has newer protocol version [%u, %u]. Please check if update for pica-node is available", + inet_ntoa(nc->addr.sin_addr), buf[2], buf[3]); + } + else + { + PICA_info("Node %s has older protocol version. Disconnecting ...", inet_ntoa(nc->addr.sin_addr)); + } + return 0; } -- cgit v1.2.1