Add debug output

This commit is contained in:
antao 2018-08-20 17:05:59 +08:00
parent a6fe81a003
commit c2c072b9ec
2 changed files with 18 additions and 13 deletions

View File

@ -12,6 +12,10 @@ HttpClientImpl::HttpClientImpl(trantor::EventLoop *loop,
_useSSL(useSSL)
{
}
HttpClientImpl::~HttpClientImpl()
{
LOG_TRACE<<"Deconstruction HttpClient";
}
void HttpClientImpl::sendRequest(const drogon::HttpRequestPtr &req, const drogon::HttpReqCallback &callback)
{

View File

@ -21,17 +21,18 @@
namespace drogon{
class HttpClientImpl:public HttpClient,public std::enable_shared_from_this<HttpClientImpl>
{
public:
HttpClientImpl(trantor::EventLoop *loop,const trantor::InetAddress &addr,bool useSSL=false);
virtual void sendRequest(const HttpRequestPtr &req,const HttpReqCallback &callback) override;
private:
std::shared_ptr<trantor::TcpClient> _tcpClient;
trantor::EventLoop *_loop;
trantor::InetAddress _server;
bool _useSSL;
void sendReq(const trantor::TcpConnectionPtr &connectorPtr,const HttpRequestPtr &req);
void sendRequestInLoop(const HttpRequestPtr &req,const HttpReqCallback &callback);
std::queue<std::pair<HttpRequestPtr,HttpReqCallback>> _reqAndCallbacks;
void onRecvMessage(const trantor::TcpConnectionPtr&,trantor::MsgBuffer*);
};
public:
HttpClientImpl(trantor::EventLoop *loop,const trantor::InetAddress &addr,bool useSSL=false);
virtual void sendRequest(const HttpRequestPtr &req,const HttpReqCallback &callback) override;
~HttpClientImpl();
private:
std::shared_ptr<trantor::TcpClient> _tcpClient;
trantor::EventLoop *_loop;
trantor::InetAddress _server;
bool _useSSL;
void sendReq(const trantor::TcpConnectionPtr &connectorPtr,const HttpRequestPtr &req);
void sendRequestInLoop(const HttpRequestPtr &req,const HttpReqCallback &callback);
std::queue<std::pair<HttpRequestPtr,HttpReqCallback>> _reqAndCallbacks;
void onRecvMessage(const trantor::TcpConnectionPtr&,trantor::MsgBuffer*);
};
}