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 compilation errors from server.c example #80

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

mmsaki
Copy link
Contributor

@mmsaki mmsaki commented Aug 23, 2024

Server code example has some errors that I fixed on the PR

  • updated addr_len to use type socklen_t
  • fix the while condition to use == instead of =

@CLAassistant
Copy link

CLAassistant commented Aug 23, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@drbruced12 drbruced12 left a comment

Choose a reason for hiding this comment

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

The change in line 330 is correct but the change to line 355/356 is not correct. We are not testing whether buf_len equals the return value of the recv call (bytes received); we are testing whether the recv call succeeded. If it returns zero bytes (nothing could be read) we exit the while loop.

If you remove the second change from the PR we will be able to merge it.

@mmsaki
Copy link
Contributor Author

mmsaki commented Sep 9, 2024

@drbruced12 I Fixed line 355/356

@drbruced12 drbruced12 merged commit 1da9130 into SystemsApproach:master Sep 9, 2024
1 of 2 checks passed
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.

3 participants