This PR implements File; a simple RAII wrapper to provide ownership semantics to file descriptors, as well as some initial work on persistent connections.
Changes
Added connection state to Response (should default to KeepAlive). This defines if the connection should close after sending the response.
Refactored tasks to use File.
ServerSendResponseTask will now enqueue a new ServerReceiveRequestTask, unless the response specifies the connection should be closed.
Presence of Connection: close (case-insensitive) in request headers will now propagate the connection option to responses.
NOTE: The addition of a connection option makes the inheritance-style request architecture a little bit clunky and could surely be more readable refactored to a builder pattern, but that's outside the scope of this PR and not a current necessity/priority
TODO
[x] ~Implement some type of lingering close if possible, and update config timeout value accordingly~ (deferred: #33)
[x] Collect and implement connection management related spec requirements (#32)
[x] Parse and respect connection headers when receiving requests
This PR implements File; a simple RAII wrapper to provide ownership semantics to file descriptors, as well as some initial work on persistent connections.
Changes
Response
(should default toKeepAlive
). This defines if the connection should close after sending the response.File
.ServerSendResponseTask
will now enqueue a newServerReceiveRequestTask
, unless the response specifies the connection should be closed.Connection: close
(case-insensitive) in request headers will now propagate the connection option to responses.TODO