public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH gwhttpd 0/7] gwhttpd updates
@ 2022-06-26  5:56 Ammar Faizi
  2022-06-26  5:56 ` [PATCH gwhttpd 1/7] gwhttpd: Do an early return when parse_http_header fails Ammar Faizi
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Ammar Faizi @ 2022-06-26  5:56 UTC (permalink / raw)
  To: GNU/Weeb Mailing List; +Cc: Ammar Faizi, Arthur Lapz, Sprite, Yonle

Hi,

This series contains gwhttpd refactoring and updates. I am going
to add directory traversing support feature, but before that,
several cleanups need to get done. And here it is...

Summary below...

## Patch 1
Don't continue executing the next line if we fail to parse the
HTTP header, that's the wrong path, we should stop the client
early.

## Patch 2
This mlock is just optional, don't bother showing error.

## Patch 3
Let the caller close the connection, we need to have more decisions
in the caller rather than closing it directly.

## Patch 4
Print a log message that we are interrupted, this makes the app user
friendly because the user can explicitly see from the output that the
app is interrupted.

## Patch 5
The HTTP header parser was prone and doesn't handle many edge cases.
This is a full refactor of HTTP header parser. While in there, add
more HTTP method supports.

## Patch 6
When we fail to send() due to EAGAIN, we retry the send(). However,
if we are spinning on this retry for so long, this will eat CPU cycle
and slow down the entire application. We should stop retrying at
some point. Add a loop counter and return -ENETDOWN if we are failing
too many times in the send() retry loop cycle.

## Patch 7
A patch for Makefile. Add a command to clean the binary file.

Signed-off-by: Ammar Faizi <[email protected]>
---

Ammar Faizi (7):
  gwhttpd: Do an early return when parse_http_header fails
  gwhttpd: Don't print any error when mlock fails
  gwhttpd: Replace `send_error_and_close` with `send_http_error()`
  gwhttpd: Add log in the interrupt handler
  gwhttpd: Refactor HTTP header parser
  gwhttpd: Avoid endless busy spinning on `send()`
  Makefile: Add "make clean" command

 Makefile    |   3 +
 gwhttpd.cpp | 220 +++++++++++++++++++++++++++++++++++++---------------
 2 files changed, 161 insertions(+), 62 deletions(-)

base-commit: 944b77d9aaac4a88729da6ec2f76447a9c3562ab
-- 
Ammar Faizi


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-26  5:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-26  5:56 [PATCH gwhttpd 0/7] gwhttpd updates Ammar Faizi
2022-06-26  5:56 ` [PATCH gwhttpd 1/7] gwhttpd: Do an early return when parse_http_header fails Ammar Faizi
2022-06-26  5:56 ` [PATCH gwhttpd 2/7] gwhttpd: Don't print any error when mlock fails Ammar Faizi
2022-06-26  5:56 ` [PATCH gwhttpd 3/7] gwhttpd: Replace `send_error_and_close` with `send_http_error()` Ammar Faizi
2022-06-26  5:56 ` [PATCH gwhttpd 4/7] gwhttpd: Add log in the interrupt handler Ammar Faizi
2022-06-26  5:56 ` [PATCH gwhttpd 5/7] gwhttpd: Refactor HTTP header parser Ammar Faizi
2022-06-26  5:56 ` [PATCH gwhttpd 6/7] gwhttpd: Avoid endless busy spinning on `send()` Ammar Faizi
2022-06-26  5:56 ` [PATCH gwhttpd 7/7] Makefile: Add "make clean" command Ammar Faizi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox