Skip to content

Improve HTTP server error handling and cleanup #15

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

Merged
merged 1 commit into from
Jun 25, 2025

Conversation

Jordymalone
Copy link
Contributor

This change introduces a single, well-defined cleanup path for the worker thread. On buffer allocation failure or receive errors, the code now frees the buffer, shuts down the socket, and propagates the original error back to the caller. The daemon also releases the socket when kthread creation fails. These adjustments prevent resource-leak scenarios and keep error codes intact, making the server more resilient to low-memory conditions and network-level faults.

This change introduces a single, well-defined cleanup path for the
worker thread. On buffer allocation failure or receive errors, the code
now frees the buffer, shuts down the socket, and propagates the
original error back to the caller. The daemon also releases the socket
when kthread creation fails. These adjustments prevent resource-leak
scenarios and keep error codes intact, making the server more resilient
to low-memory conditions and network-level faults.
@jserv jserv merged commit 0cca527 into sysprog21:master Jun 25, 2025
@jserv
Copy link
Contributor

jserv commented Jun 25, 2025

Thank @Jordymalone for contributing!

@Jordymalone Jordymalone deleted the fix-error-handling branch June 26, 2025 12:19
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.

2 participants