-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
WebServer - change occurrence of client.flush() to clear() #10234
WebServer - change occurrence of client.flush() to clear() #10234
Conversation
👋 Hello JAndrassy, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 56 files - 83 56 suites - 83 5m 30s ⏱️ - 1h 37m 39s Results for commit e21f973. ± Comparison against base commit cd3d0bf. This pull request removes 9 tests.
♻️ This comment has been updated with latest results. |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
as follow up of changing flush() to clear() in networking with PR #9453, there is an unclear use of flush() in WebServer.
in Parsing.cpp the client.flush() is at the end of the processing of the HTTP request. the response is already sent. If the connection is not kept alive for the next request, then it is closed so why clearing it. If the connection is kept alive for the following HTTP request, then clear() could delete beginning of the following request. But characters remaining in the buffer would make the following request invalid too. So for a reused connection the processing of the request should ensure to read until the exact end of the request. I don't know if that is fulfilled.
Anyway client.flush() did clear the receive buffer in previous versions so this would return it to that.