1
This commit is contained in:
parent
09ad4bea1d
commit
b3f165760b
@ -234,19 +234,19 @@ std::shared_ptr<RequestTarget> MasterMgr::GetRequestByContextId(long long contex
|
|||||||
|
|
||||||
void MasterMgr::AddHttpTunnelRequest(int socket_handle, std::shared_ptr<f8::JsonHttpRequest> request)
|
void MasterMgr::AddHttpTunnelRequest(int socket_handle, std::shared_ptr<f8::JsonHttpRequest> request)
|
||||||
{
|
{
|
||||||
pending_http_tunnel_hash_[socket_handle] = request;
|
pending_http_tunnel_socket_hash_[socket_handle] = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MasterMgr::RemoveHttpTunnelRequest(int socket_handle)
|
void MasterMgr::RemoveHttpTunnelRequest(int socket_handle)
|
||||||
{
|
{
|
||||||
auto req = GetHttpTunnelRequest(socket_handle);
|
auto req = GetHttpTunnelRequest(socket_handle);
|
||||||
if (req) {
|
if (req) {
|
||||||
pending_http_tunnel_hash_.end();
|
pending_http_tunnel_socket_hash_.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<f8::JsonHttpRequest> MasterMgr::GetHttpTunnelRequest(int socket_handle)
|
std::shared_ptr<f8::JsonHttpRequest> MasterMgr::GetHttpTunnelRequest(int socket_handle)
|
||||||
{
|
{
|
||||||
auto itr = pending_http_tunnel_hash_.find(socket_handle);
|
auto itr = pending_http_tunnel_socket_hash_.find(socket_handle);
|
||||||
return itr != pending_http_tunnel_hash_.end() ? itr->second : nullptr;
|
return itr != pending_http_tunnel_socket_hash_.end() ? itr->second : nullptr;
|
||||||
}
|
}
|
||||||
|
@ -38,18 +38,20 @@ class MasterMgr : public a8::Singleton<MasterMgr>
|
|||||||
int proto_version);
|
int proto_version);
|
||||||
void RemoveRequest(int socket_handle);
|
void RemoveRequest(int socket_handle);
|
||||||
void AddHttpTunnelRequest(int socket_handle, std::shared_ptr<f8::JsonHttpRequest> request);
|
void AddHttpTunnelRequest(int socket_handle, std::shared_ptr<f8::JsonHttpRequest> request);
|
||||||
void RemoveHttpTunnelRequest(int socket_handle);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<f8::JsonHttpRequest> GetHttpTunnelRequest(int socket_handle);
|
std::shared_ptr<f8::JsonHttpRequest> GetHttpTunnelRequest(int socket_handle);
|
||||||
std::shared_ptr<RequestTarget> GetRequestBySocket(int socket_handle);
|
std::shared_ptr<RequestTarget> GetRequestBySocket(int socket_handle);
|
||||||
std::shared_ptr<RequestTarget> GetRequestByContextId(long long context_id);
|
std::shared_ptr<RequestTarget> GetRequestByContextId(long long context_id);
|
||||||
std::shared_ptr<Master> GetConnById(int instance_id);
|
std::shared_ptr<Master> GetConnById(int instance_id);
|
||||||
|
void RemoveHttpTunnelRequest(int socket_handle);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
long long curr_context_id_ = 0;
|
long long curr_context_id_ = 0;
|
||||||
std::map<int, std::shared_ptr<Master>> mastersvr_hash_;
|
std::map<int, std::shared_ptr<Master>> mastersvr_hash_;
|
||||||
|
|
||||||
std::map<int, std::shared_ptr<RequestTarget>> pending_socket_hash_;
|
std::map<int, std::shared_ptr<RequestTarget>> pending_socket_hash_;
|
||||||
std::map<long long, std::shared_ptr<RequestTarget>> pending_context_hash_;
|
std::map<long long, std::shared_ptr<RequestTarget>> pending_context_hash_;
|
||||||
std::map<int, std::shared_ptr<f8::JsonHttpRequest>> pending_http_tunnel_hash_;
|
|
||||||
|
std::map<int, std::shared_ptr<f8::JsonHttpRequest>> pending_http_tunnel_socket_hash_;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user