size change in receiver call back API now streamed, gui allows smaller packet size than expected to be caught and replaced the rest with 0xFF

This commit is contained in:
2018-03-21 17:08:38 +01:00
parent a1936cb884
commit a74e8f68f7
16 changed files with 83 additions and 54 deletions

View File

@ -24,6 +24,7 @@ using namespace rapidjson;
#define MAX_STR_LENGTH 1000
//#define ZMQ_DETAIL
#define ROIVERBOSITY
class ZmqSocket {
@ -426,7 +427,15 @@ public:
memcpy(buf, (char*)zmq_msg_data(&message), size);
}
//incorrect size
//incorrect size (smaller)
else if (length < size){
#ifdef ROIVERBOSITY
cprintf(RED,"Error: Received smaller packet size %d for socket %d\n", length, index);
#endif
memcpy(buf, (char*)zmq_msg_data(&message), length);
memset(buf+length,0xFF,size-length);
}
//incorrect size (larger)
else {
cprintf(RED,"Error: Received weird packet size %d for socket %d\n", length, index);
memset(buf,0xFF,size);