mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-05 09:22:54 +03:00
examples/coap-rd.c: Replace debug() with coap_log(LOG_DEBUG, )
This commit is contained in:
1 parent
843f036b16
commit
032a46fcb3
1 file changed
+7
-5
+7
-5
@@ -149,7 +149,8 @@ hnd_put_resource(coap_context_t *ctx UNUSED_PARAM,
|
||||
|
||||
tmp.s = (unsigned char *)coap_malloc(tmp.length);
|
||||
if (!tmp.s) {
|
||||
debug("hnd_put_rd: cannot allocate storage for new rd\n");
|
||||
coap_log(LOG_DEBUG,
|
||||
"hnd_put_rd: cannot allocate storage for new rd\n");
|
||||
code = COAP_RESPONSE_CODE(503);
|
||||
goto finish;
|
||||
}
|
||||
@@ -179,7 +180,8 @@ hnd_put_resource(coap_context_t *ctx UNUSED_PARAM,
|
||||
response = coap_pdu_init(type, code, request->hdr->id, size);
|
||||
|
||||
if (!response) {
|
||||
debug("cannot create response for message %d\n", request->hdr->id);
|
||||
coap_log(LOG_DEBUG, "cannot create response for message %d\n",
|
||||
request->hdr->id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -187,7 +189,7 @@ hnd_put_resource(coap_context_t *ctx UNUSED_PARAM,
|
||||
coap_add_token(response, request->hdr->token_length, request->hdr->token);
|
||||
|
||||
if (coap_send(ctx, peer, response) == COAP_INVALID_TID) {
|
||||
debug("hnd_get_rd: cannot send response for message %d\n",
|
||||
coap_log(LOG_DEBUG, "hnd_get_rd: cannot send response for message %d\n",
|
||||
request->hdr->id);
|
||||
}
|
||||
#endif
|
||||
@@ -356,14 +358,14 @@ make_rd(coap_pdu_t *pdu) {
|
||||
rd = rd_new();
|
||||
|
||||
if (!rd) {
|
||||
debug("hnd_get_rd: cannot allocate storage for rd\n");
|
||||
coap_log(LOG_DEBUG, "hnd_get_rd: cannot allocate storage for rd\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (coap_get_data(pdu, &rd->data.length, &data)) {
|
||||
rd->data.s = (unsigned char *)coap_malloc(rd->data.length);
|
||||
if (!rd->data.s) {
|
||||
debug("hnd_get_rd: cannot allocate storage for rd->data\n");
|
||||
coap_log(LOG_DEBUG, "hnd_get_rd: cannot allocate storage for rd->data\n");
|
||||
rd_delete(rd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user