When darkhttpd is running with `--timeout 0` (timeout disabled), and any
connection is idle, it will use 100% of the CPU. This happens because
`select` returns immediately when its timeout is zero, causing the main
`httpd_poll` loop to spin.
Fix this by adding a check to `httpd_poll` making `select` always
receive a `NULL` timeout when `timeout_secs` is zero.
A client making quick consecutive requests with keep-alive, such as `ab`
with `-k`, can cause the connection to become hung.
This happens because of an optimization in `http_poll` function. When a
connection state becomes `DONE`, `httpd_poll` recycles the connection
and immediately calls `poll_recv_request`. However, it doesn't handle
this resulting in the connection state becoming `DONE` again. If this
occurs, the state stays in `DONE`, and the further calls to `httpd_poll`
ignore the connection.
Fix this by calling `poll_recv_request` in a loop until the state is no
longer `DONE`.
* Enable TCP_NODELAY optimization
It looks like `TCP_NODELAY` was disabled due to the bug fixed in the
previous commit. Enabling it substantially improves keep-alive
performance with `ab`:
Before:
```
Time per request: 0.272 [ms] (mean)
```
After:
```
Time per request: 0.033 [ms] (mean)
```
* Remove keep-alive optimization from `httpd_poll`
Benchmarking with `ab` shows that bypassing `select` for keep-alive
connections in the `DONE` state doesn't significantly impact
performance. Since this optimization previously caused a bug, remove it.
Since the feature (and security and limitations) list follows the
"Features:" (etc.) line without any empty lines between them,
some Markdown-to-HTML converters (correctly) assume that
they are one paragraph, which causes the list not to
be converted to an actual HTML list. By putting an empty line
between the actual lists and their preceding lines,
the lists will be correctly converted.
(Both lists and paragraphs are block elements,
and they should be "marked down" accordingly.
See https://daringfireball.net/projects/markdown/syntax#block .)
Commonly found in Apache log. It adds 2 fields upon the Common Log
Format (referer and user-agent).
https://en.wikipedia.org/wiki/Common_Log_Format
It is just a matter of reordering what your were already logging with a
new date formatting.
* We are cheating because we always assume HTTP/1.1 as the request
header.
* We assume the user name is unknown.