Note the referrer of the URL

This commit is contained in:
DennisOSRM 2012-05-03 11:07:53 +02:00
parent 26662b7190
commit 200028f328
3 changed files with 5 additions and 1 deletions

View File

@ -52,6 +52,7 @@ enum CompressionType {
struct Request {
std::string uri;
std::string referrer;
boost::asio::ip::address endpoint;
};

View File

@ -58,7 +58,7 @@ public:
Tm=localtime(&ltime);
INFO((Tm->tm_mday < 10 ? "0" : "" ) << Tm->tm_mday << "-" << (Tm->tm_mon < 10 ? "0" : "" ) << Tm->tm_mon << "-" << 1900+Tm->tm_year << " " << (Tm->tm_hour < 10 ? "0" : "" ) << Tm->tm_hour << ":" << (Tm->tm_min < 10 ? "0" : "" ) << Tm->tm_min << ":" << (Tm->tm_sec < 10 ? "0" : "" ) << Tm->tm_sec << " " <<
req.endpoint.to_string() << " " << request );
req.endpoint.to_string() << " " << req.referrer << " " << request );
std::string command;
std::size_t firstAmpPosition = request.find_first_of("?");
command = request.substr(1,firstAmpPosition-1);

View File

@ -164,6 +164,9 @@ private:
*compressionType = gzipRFC1952;
}
if(header.name == "Referer")
req.referrer = header.value;
if (input == '\r') {
state_ = expecting_newline_3;
return boost::indeterminate;