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

net/gcoap: change return type from gcoap_req_send() to ssize_t #16526

Merged
merged 1 commit into from
Jun 5, 2021

Conversation

janosbrodbeck
Copy link
Member

@janosbrodbeck janosbrodbeck commented Jun 4, 2021

Contribution description

gcoap_req_send() does not allow returning negative values to indicate errors. For the support of DTLS in gcoap it is useful to return error codes here to specify what went wrong (e.g. authentication failed) and not only return that 0 bytes were sent.

This PR only changes the return type from size_t to ssize_t to allow this. The cast to size_t at the end is not necessary anymore, since res is already the right type now.

Testing procedure

Reading and compiling examples/gcoap should be enough. It works the same as before.

Issues/PRs references

@github-actions github-actions bot added Area: CoAP Area: Constrained Application Protocol implementations Area: network Area: Networking Area: sys Area: System labels Jun 4, 2021
@janosbrodbeck janosbrodbeck added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: CoAP Area: Constrained Application Protocol implementations Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. and removed Area: CoAP Area: Constrained Application Protocol implementations Area: network Area: Networking Area: sys Area: System labels Jun 4, 2021
@github-actions github-actions bot added Area: network Area: Networking Area: sys Area: System labels Jun 4, 2021
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

ACK. Behavior is not changed and (apart from very large and thus unlikely existing packages) the usage should also not change.

@miri64 miri64 merged commit 9a6afec into RIOT-OS:master Jun 5, 2021
@jeandudey jeandudey added this to the Release 2021.07 milestone Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: CoAP Area: Constrained Application Protocol implementations Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants