aboutsummaryrefslogtreecommitdiffstats
path: root/include/http_connection.h
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2014-08-07 08:31:27 +0900
committeripknHama <ipknhama@gmail.com>2014-08-07 08:31:27 +0900
commitc36aa219e25e26019035fe3465471fd510778422 (patch)
treebea27ec5e1adb3681babd7c818a7de5cb7551e4d /include/http_connection.h
parent81fcf4af0127d93e817877d0ce1223b606d30fd6 (diff)
downloadcrow-c36aa219e25e26019035fe3465471fd510778422.tar.gz
crow-c36aa219e25e26019035fe3465471fd510778422.zip
now crow becomes completely header only
Diffstat (limited to 'include/http_connection.h')
-rw-r--r--include/http_connection.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/http_connection.h b/include/http_connection.h
index d73398e..a030d73 100644
--- a/include/http_connection.h
+++ b/include/http_connection.h
@@ -1,11 +1,12 @@
#pragma once
#include <boost/asio.hpp>
#include <boost/algorithm/string/predicate.hpp>
+#include <boost/lexical_cast.hpp>
#include <atomic>
#include <chrono>
#include <array>
-#include <http_parser.h>
+#include "http_parser_merged.h"
#include "datetime.h"
#include "parser.h"
@@ -29,7 +30,8 @@ namespace crow
handler_(handler),
parser_(this),
server_name_(server_name),
- deadline_(socket_.get_io_service())
+ deadline_(socket_.get_io_service()),
+ address_str_(boost::lexical_cast<std::string>(socket_.remote_endpoint()))
{
#ifdef CROW_ENABLE_DEBUG
connectionCount ++;
@@ -89,7 +91,7 @@ namespace crow
}
}
- CROW_LOG_INFO << "Request: "<< this << " HTTP/" << parser_.http_major << "." << parser_.http_minor << ' '
+ CROW_LOG_INFO << "Request: " << address_str_ << " " << this << " HTTP/" << parser_.http_major << "." << parser_.http_minor << ' '
<< method_name(req.method) << " " << req.url;
@@ -308,6 +310,7 @@ namespace crow
std::string date_str_;
boost::asio::deadline_timer deadline_;
+ std::string address_str_;
};
}