goto error_early;
}
- if ((size_t) bytes_read < sizeof(coap_hdr_t)) {
- debug("coap_read: discarded invalid frame\n");
- goto error_early;
+ if (bytes_read == 0) {
+ goto error_early;
+ }
+
+ else if ((size_t) bytes_read < sizeof(coap_hdr_t)) {
+ debug("coap_read: discard invalid frame\n");
+ goto error_early;
}
if (pdu->version != COAP_DEFAULT_VERSION) {
* @return 0 - success, else - TBD error
*/
OCStackResult OCProcessCoAP() {
-
- OC_LOG(INFO, TAG, PCF("Entering OCProcessCoAP"));
int read = 0;
read = coap_read(gCoAPCtx, gCoAPCtx->sockfd);
if(read > 0) {
timeout.tv_usec = 5000;
fd_set reads;
- OC_LOG_V(DEBUG, MOD_NAME, "%s Begin", __func__ );
-
FD_ZERO(&reads);
FD_SET(sockfd, &reads);
ret = select(sockfd + 1, &reads, NULL, NULL, &timeout);
return ret;
}
if (!FD_ISSET(sockfd, &reads)) {
- OC_LOG(DEBUG, MOD_NAME, "No data to read");
return ERR_SUCCESS;
}
if (ret < 1) {
OC_LOG(FATAL, MOD_NAME, "OCRecvFrom ERR");
}
- OC_LOG_V(DEBUG, MOD_NAME, "%s End", __func__ );
+
return ret;
}
uint8_t ipAddr[4] = { 0 };
uint16_t port = 0;
- OC_LOG(INFO, TAG, PCF("Entering RequestPresence"));
ClientCB* cbNode = NULL;
OCDevAddr dst;
OCClientResponse clientResponse;
* OC_STACK_OK - no errors
* OC_STACK_ERROR - stack process error
*/
-OCStackResult OCProcess() {
-
- OC_LOG(INFO, TAG, PCF("Entering OCProcess"));
+OCStackResult OCProcess()
+{
#ifdef WITH_PRESENCE
OCProcessPresence();
#endif