Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Variables Http1Config.maxReadAttempts

1
2
3

Documentation

The maximum number of times the reader will attempt to read data from the socket before giving up and returning an error (in certain circumstances).

Imagine this situtation: There is a bad actor trying to exhuast the server's resources by opening a bunch of connections, sending just enough data at just enough of a rate to keep the connection alive, but not enough to actually send a request.

The reader in this case could be trying to just parse a request line, so is looking for a \r\nthat never ends up coming. If after maxReadAttemptsthe reader still hasn't found the \r\n, it will return an error as it assumes the client is acting in bad faith.

Body data is not included in this check currently, as a better method/heuristic is needed for large bodies.

This also does not apply to transport layer errors, such as the socket being closed by the client and I/O timeouts.

ON THIS PAGE