- printf("Receive data error: '%s'\n", strerror(errno));
- close(outerSocket);
- errorMsg = RECV_DATA_ANSWER_ERROR;
- return st_recv_fail;
+ int ret = recv(outerSocket, &bufferS[ENC_MSG_LEN - toRead], toRead, 0);
+ if (ret <= 0)
+ {
+ printf("Receive data error: '%s'\n", strerror(errno));
+ close(outerSocket);
+ errorMsg = RECV_DATA_ANSWER_ERROR;
+ return st_recv_fail;
+ }
+ toRead -= ret;