-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code review and cleanup of http_receive()
Improve readabilty by moving conditionals that operate on 'n' right after assignment of 'n'. The conditional at the end of the loop: while (n > = 0) has been replaced by this conditional: if (n < = 0) and this one that triggers a tight 2nd loop: (n == ERR_SSL_AGAIN) ⇔ if (n == 0) The new codes *returns from the function* with ERR_HTTP_SSL upon: if (n < 0) The previous code would only *leave the loop* upon: if (n < 0) and then return from the function with ERR_HTTP_SSL only upon: if (!header) Therefore SSL violations were silently ignored after reading the header and while reading the body of the HTTP response. Increase the HTTP buffer capacity when needed. You never know. The previous size of 32 KB used to work well from 2015 to 2020. In 2020 a case was reported where 32 KB were not enough anymore and we increased the buffer size to 64 KB. Someday 64 KB might not be enough either. Yet in most cases 32 KB are more than enough. So start with 32 KB and increase well beyond 64 KB if needed, instead of bailing out with ERR_HTTP_SSL. These changes will help introduce 3rd party HTTP parsing code if we decide to go that way.
- Loading branch information
1 parent
8b0c235
commit f608fce
Showing
3 changed files
with
112 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters