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

Fix lwip implementation to use appropriate type for timeouts for socket options setting #7

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

paul-szczepanek-arm
Copy link
Contributor

@paul-szczepanek-arm paul-szczepanek-arm commented May 9, 2022

The API specifies an int of ms but lwip can also use timeval based on build options. This translates the values between implementation and API.

@paul-szczepanek-arm
Copy link
Contributor Author

To avoid similar problems we should specify the options in the API, see: #8

if (rc == 0) {
sock_attr[socket-LWIP_SOCKET_OFFSET].tv_sec = *(const uint32_t *)opt_val / 1000U;
sock_attr[socket-LWIP_SOCKET_OFFSET].tv_msec = *(const uint32_t *)opt_val % 1000U;
case IOT_SOCKET_SO_SNDTIMEO: ; /* do not remove the semi-colon */
Copy link

Choose a reason for hiding this comment

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

I would add to the commit message the intention with ; being placed here. It's important detail why are we doing this.

The semicolon is needed after the label because the langage spec forbids
non-code statements following directly after a label (causing compile
error)
@paul-szczepanek-arm
Copy link
Contributor Author

I added a comment in the commit message

@RobertRostohar
Copy link
Contributor

The commit (3188c55) should properly fix the lwIP implementation. Pleas check and close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants