This adds a write_timeout option, similar to existing option read_timeout, but for timeout while writing responses.
The usecase is to detect and fail early if a client doesn't promptly read & ack response packets. (Either regular client, or intentionally malicious client doing a "slow read" attack).
In order to implement it properly and have identical semantics to read_timeout, I needed to refactor to switch sending to be chunk-based.
I'm new to this codebase, feedback would be great!
The other things we could do:
just be ok with write_timeout not being chunk-based the same way read_timeout is, and have it be for the entire response (though I'm worried this wouldn't be as reliable detection of slow clients)
make MAX_SEND configurable as well?
if write_timeout not set, use the existing code, otherwise if write_timeout is set we do the chunk-based.
This adds a write_timeout option, similar to existing option read_timeout, but for timeout while writing responses.
The usecase is to detect and fail early if a client doesn't promptly read & ack response packets. (Either regular client, or intentionally malicious client doing a "slow read" attack).
In order to implement it properly and have identical semantics to read_timeout, I needed to refactor to switch sending to be chunk-based.
I'm new to this codebase, feedback would be great!
The other things we could do: