-
Notifications
You must be signed in to change notification settings - Fork 424
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
coap_add_attr() does not take ownership over passed data(name/val) #10
Comments
Using these attributes, you can pass literal character strings such as those used in the example server application as well as dynamically generated strings easily. Note that libcoap specifically has been designed to provide a very tight coupling between low-level operations and the application that use this library to meet the requirement of highly-optimized embedded applications. |
Oh... I see... |
Update LOG_ to COAP__LOG_
Update LOG_ to COAP_LOG_
Update LOG_ to COAP_LOG_
Update LOG_ to COAP_LOG_
https://github.com/obgm/libcoap/blob/develop/src/resource.c#L333-L334
I understand that as of current it is user's responsibility to ensure that passed pointers are valid.
But i think it would be more rational for
coap_attr_t
struct to take ownership over passed values.After all this strcture belongs to resource now and user should not change values inside of it without using a proper API. Though there is none for such needs as of current...
I didn't look into other places, but i would generally think that taking ownership of all resources would be right for library and its structures. Otherwise the line between library and application becomes dim.
UPD:
The same for uri in
coap_resource_init
The text was updated successfully, but these errors were encountered: