-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
LWM2M: fix handle_reqest() errors #1273
LWM2M: fix handle_reqest() errors #1273
Conversation
d76f801
to
bbbc803
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some description of what the patch does in commit messages, for instance the last one: sure it does what it's commit title says, but why? A little bit of background is nice for git history.
@@ -2029,7 +2029,8 @@ static int handle_request(struct zoap_packet *request, | |||
obj = get_engine_obj(path.obj_id); | |||
if (!obj) { | |||
/* No matching object found - ignore request */ | |||
return -ENOENT; | |||
r = -ENOENT; | |||
goto error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch could be merged to the first one:
"refactor handle_request() error handling "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -2158,7 +2158,7 @@ static int handle_request(struct zoap_packet *request, | |||
|
|||
default: | |||
SYS_LOG_ERR("Unknown operation: %u", context.operation); | |||
return -EINVAL; | |||
r = -EINVAL; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that one could be merged with the first of this patch-set too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
bbbc803
to
a0b54af
Compare
Update according to @tbursztyka 's review. |
@jukkar , @mike-scott please help to take a look at the patches. thanks |
Will do later. Sorry for delay. I had too many patches in too many branches today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing approval for now till we work out a merge order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Er.. approval removing..
@mike-scott I think so. I suggest that we can merge #1255 first and then this one and then #1049. |
1) Respond NOT FOUND to caller when object doesn't exist 2) Report as internal server error when OP not handled Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Return 4.05 Method Not Allowed when path is empty ('/') to the caller for it's only use by bootstrap delete. This change also avoid the empty path being treated as request targeted at 0/0/0. Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Modify zoap_options_to_path() to return error when URI contains character other than digits and return 4.04 NOT FOUND to caller. PATH such as "/1a/2/3" was treated as "/1/2/3" after parsring which is incorrect. Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
".well-known/core" is mainly used with method GET for performing the resource discovery (RFC 6690). Since we are implementing a LwM2M client and is not implement a resource directory which allow others to do the resource registration (POST to .well-known/core). Only GET method is allowed for the usage. Report 4.5 (Method Not Allowed) if other methods are requested. Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
a0b54af
to
3b7b766
Compare
Rebase on top of the master branch for #4380 is already merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@tbursztyka could you please help to take a look at commits and share your opinions? thanks |
Tomasz is on vacation still next week. I try to get @nashif to merge this one as @tbursztyka comments were addressed in later versions of the PR. |
Fixes zephyrproject-rtos#1282 Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
'/' is only allowed when performing bootstrap-delete