From 0a80323f84b00dee8771d19910b100800d86dbde Mon Sep 17 00:00:00 2001 From: an-tao <20741618@qq.com> Date: Fri, 1 Jun 2018 14:07:34 +0800 Subject: [PATCH] fix some bugs --- drogon_ctl/create_view.cc | 2 +- lib/src/HttpRequestImpl.cc | 4 ++-- lib/src/HttpRequestImpl.h | 9 +++++---- lib/src/HttpResponseImpl.cc | 2 +- lib/src/HttpResponseImpl.h | 8 ++++---- trantor | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drogon_ctl/create_view.cc b/drogon_ctl/create_view.cc index c3ad5c37..d32880e1 100755 --- a/drogon_ctl/create_view.cc +++ b/drogon_ctl/create_view.cc @@ -44,7 +44,7 @@ static std::string& replace_all(std::string& str,const std::string& old_ } return str; } -static void parseCxxLine(std::ofstream &oSrcFile,const std::string line,const std::string streamName,const std::string viewDataName) +static void parseCxxLine(std::ofstream &oSrcFile,const std::string& line,const std::string& streamName,const std::string& viewDataName) { if(line.length()>0) diff --git a/lib/src/HttpRequestImpl.cc b/lib/src/HttpRequestImpl.cc index 5d233f51..3ff789eb 100755 --- a/lib/src/HttpRequestImpl.cc +++ b/lib/src/HttpRequestImpl.cc @@ -78,7 +78,7 @@ void HttpRequestImpl::parsePremeter() if(epos != std::string::npos) { std::string key = coo.substr(0, epos); std::string::size_type cpos=0; - while(isspace(key[cpos])&&cposappend(buf); output->append(statusMessage_); output->append("\r\n"); - snprintf(buf, sizeof buf, "Content-Length: %zd\r\n", body_.size()); + snprintf(buf, sizeof buf, "Content-Length: %lu\r\n", body_.size()); output->append(buf); if (closeConnection_) { output->append("Connection: close\r\n"); diff --git a/lib/src/HttpResponseImpl.h b/lib/src/HttpResponseImpl.h index 1cb44349..6dbb3647 100755 --- a/lib/src/HttpResponseImpl.h +++ b/lib/src/HttpResponseImpl.h @@ -146,7 +146,7 @@ namespace drogon if(epos != std::string::npos) { std::string cookie_name = coo.substr(0, epos); std::string::size_type cpos=0; - while(isspace(cookie_name[cpos])&&cpos