This is a follow-up to #34242 and is the first few commits of #32061
As review and refinement of the replacement HTTP server progresses, some new utilities were needed and added. This PR updates those utilities as work continues on #32061.
LineReader
In order to enforce strict limits on the total size of headers in HTTPRequest, we add a method to LineReader to give us the total amount of data that has been read from the buffer so far. See #32061 (review)
CaseInsensitiveEqual
HTTP headers are case-insensitive. An early version of #32061 used an unordered_map for this and therefore we needed a comparator struct. However that unordered_map was replaced by a simpler std::vector of std::pair so we can remove the struct and use methods that already exist in the codebase.
StringToBytes
StringToBuffer was introduced in #34242 to test LineReader but review of #32061 indicated that it would be more optimal to return a span of bytes instead of a vector. See #32061 (review)
Split DynSock constructor for two usecases: listening / accepting sockets
See #32061 (review). DynSock was introduced in #30988 and is not used anywhere in master yet. If it’s used as a listening socket, it provides connected sockets. If it’s used as a connected socket, it provides I/O pipes. By making the queue of connected sockets optional we can clean up the ownership / lifetime if the class members.