From 278f7abae158794953b463a24929f6a9f66bfbf1 Mon Sep 17 00:00:00 2001 From: antao Date: Tue, 24 Jul 2018 18:50:25 +0800 Subject: [PATCH] Fix bug in HttpClient --- examples/client_example/main.cc | 5 ++++- lib/src/HttpClientImpl.cc | 4 ++-- lib/src/HttpContext.h | 3 +++ lib/src/HttpResponseImpl.h | 13 +++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/examples/client_example/main.cc b/examples/client_example/main.cc index c85b50f8..da344024 100644 --- a/examples/client_example/main.cc +++ b/examples/client_example/main.cc @@ -19,11 +19,14 @@ int main() auto client=HttpAppFramework::instance().newHttpClient(netaddr.toIp(),80); auto req=HttpAppFramework::instance().newHttpRequest(); req->setMethod(drogon::HttpRequest::kGet); + int count=0; for(int i=0;i<10;i++) - client->sendRequest(req,[](ReqResult result,const HttpResponse &response){ + client->sendRequest(req,[&](ReqResult result,const HttpResponse &response){ std::cout<<"receive response!"<