Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send: Return not found if client is NULL #795

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/reporting.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ uint8_t reporting_handleSend(lwm2m_context_t *contextP, void *fromSessionH, coap
break;
}
if (clientP == NULL)
return COAP_400_BAD_REQUEST;
return COAP_404_NOT_FOUND;
Copy link
Contributor

@rettichschnidi rettichschnidi Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning for this change?

Reading up on 404 (CoAP, HTTP: "not find a current representation for the target resource"), I get the feeling that 400 ("indicates that the server cannot or will not process the request") is more appropriate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is about Send Operation ?

For error code in LWM2M, you can also look at : LWM2M-v1.1.1@transportTable: 6.7.-4 Response Codes: Information Reporting Interface

And they say :

Send :
2.04 Changed : "Send" operation completed successfully
4.00 Bad Request : Undetermined error occurred
4.04 Not Found : Reported Object was not registered to the LwM2M Server

In Leshan, I think we send :
BAD_REQUEST this error message "no registration found" when we receive Send request from a device which is currently not registered)


format = utils_convertMediaType(message->content_type);

Expand Down
Loading