mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-13 14:13:52 +02:00
refactor: Replace HTTPServer::MaybeDispatchRequestsFromClient() with HTTPRemoteClient::TryReadRequest()
This commit is contained in:
@@ -464,16 +464,6 @@ private:
|
||||
*/
|
||||
void ThreadSocketHandler() EXCLUSIVE_LOCKS_REQUIRED(!m_request_dispatcher_mutex);
|
||||
|
||||
/**
|
||||
* Try to read HTTPRequests from a client's receive buffer.
|
||||
* Complete requests are dispatched, incomplete requests are
|
||||
* left in the buffer to wait for more data. Some read errors
|
||||
* will mark this client for disconnection.
|
||||
* @param[in] client The HTTPRemoteClient to read requests from
|
||||
*/
|
||||
void MaybeDispatchRequestsFromClient(const std::shared_ptr<HTTPRemoteClient>& client) const
|
||||
EXCLUSIVE_LOCKS_REQUIRED(!m_request_dispatcher_mutex);
|
||||
|
||||
/**
|
||||
* Close underlying socket connections for flagged clients
|
||||
* by removing their shared pointer from m_connected. If an HTTPRemoteClient
|
||||
@@ -585,6 +575,14 @@ public:
|
||||
|
||||
bool MaybeDisconnect(std::chrono::time_point<SteadyClock> now, std::chrono::seconds rpcservertimeout, bool disconnect_all);
|
||||
|
||||
/**
|
||||
* Try to read an HTTPRequest from a client's receive buffer.
|
||||
* Only complete requests are returned, incomplete requests are
|
||||
* left in the buffer to wait for more data. Some read errors
|
||||
* will mark this client for disconnection.
|
||||
*/
|
||||
static std::unique_ptr<HTTPRequest> TryReadRequest(const std::shared_ptr<HTTPRemoteClient>& client);
|
||||
|
||||
/**
|
||||
* Try to read an HTTP request from the receive buffer.
|
||||
* Updates HTTPRequest.m_state and drains buffer on error.
|
||||
|
||||
Reference in New Issue
Block a user