Commit 7f4d7a5f authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

Fixed bugs


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@28 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent 9bca917b
......@@ -108,10 +108,13 @@ int nmxp_receiveCompressedData(int isock, NMXP_CHAN_LIST *channelList) {
if(type != NMXP_MSG_COMPRESSED) {
nmxp_log(1, 0, "Type %d is not NMXP_MSG_COMPRESSED!\n", type);
} else {
nmxp_processCompressedData(buffer, length, channelList);
}
if(buffer) {
free(buffer);
}
return ret;
}
......@@ -132,6 +135,10 @@ int nmxp_receiveDecompressedData(int isock, NMXP_CHAN_LIST *channelList) {
nmxp_processDecompressedData(buffer, length, channelList);
}
if(buffer) {
free(buffer);
}
return ret;
}
......
......@@ -201,16 +201,21 @@ int nmxp_receiveMessage(int isock, NMXP_MSG_SERVER *type, void **buffer, uint32_
*length = 0;
ret = nmxp_receiveHeader(isock, type, length);
if( ret == NMXP_SOCKET_OK) {
if (*length > 0) {
*buffer = malloc(*length);
ret = nmxp_recv_ctrl(isock, *buffer, *length);
} else {
nmxp_log(1,0, "Error in nmxp_receiveMessage()\n");
}
if (*length > 0) {
*buffer = malloc(*length);
ret = nmxp_recv_ctrl(isock, *buffer, *length);
if(*type == NMXP_MSG_ERROR) {
nmxp_log(1,0, "Received ErrorMessage: %s\n", *buffer);
}
}
} else {
nmxp_log(1,0, "Error in nmxp_receiveMessage()\n");
}
return ret;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment