Revert "nhttpd: let sendfile() support files >= 2GB"

This reverts commit 9842afecad8dfb91dfd7221aedbeaf5379a89534.


Origin commit data
------------------
Commit: cf0bf3fa20
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2014-08-17 (Sun, 17 Aug 2014)
This commit is contained in:
Jacek Jendrzej
2014-08-17 15:15:22 +02:00
committed by [CST] Focus
parent 66dd571a4b
commit 2c6a4d3885
9 changed files with 34 additions and 50 deletions

View File

@@ -74,7 +74,8 @@ bool CmWebLog::OpenLogFile() {
if (LogFormat == "ELF") {
printf("#Version: 1.0\n");
printf("#Remarks: yhttpd" WEBSERVERNAME "\n");
printf("#Fields: c-ip username date time x-request cs-uri sc-status cs-method bytes time-taken x-time-request x-time-response cached\n");
printf(
"#Fields: c-ip username date time x-request cs-uri sc-status cs-method bytes time-taken x-time-request x-time-response cached\n");
}
}
pthread_mutex_unlock(&WebLog_mutex);
@@ -146,7 +147,7 @@ void CmWebLog::AddLogEntry_CLF(CyhookHandler *hh)
std::string c_ip = hh->UrlData["clientaddr"].c_str();
std::string request_startline = hh->UrlData["startline"].c_str();
int s_status = hh->httpStatus;
off_t bytes = hh->GetContentLength();
int bytes = hh->GetContentLength();
struct tm *time_now;
time_t now = time(NULL);
@@ -155,12 +156,12 @@ void CmWebLog::AddLogEntry_CLF(CyhookHandler *hh)
time_now = localtime(&now);
strftime(request_time, 80, "[%d/%b/%Y:%H:%M:%S]", time_now);
printf("%s - - %s \"%s\" %d %lld\n",
printf("%s - - %s \"%s\" %d %d\n",
c_ip.c_str(),
request_time,
request_startline.c_str(),
s_status,
(long long) bytes);
bytes);
}
//-----------------------------------------------------------------------------
@@ -318,7 +319,7 @@ void CmWebLog::AddLogEntry_ELF(CyhookHandler *hh)
std::string request_startline = hh->UrlData["startline"].c_str();
std::string cs_uri = hh->UrlData["fullurl"];
int sc_status = hh->httpStatus;
off_t bytes = hh->GetContentLength();
int bytes = hh->GetContentLength();
int cached = (hh->HookVarList["CacheCategory"].empty()) ? 0 : 1;
struct tm *time_now;
@@ -338,7 +339,7 @@ void CmWebLog::AddLogEntry_ELF(CyhookHandler *hh)
std::string time_taken_response = hh->HookVarList["enlapsed_response"];
long time_taken = atoi(time_taken_request.c_str()) + atoi(time_taken_response.c_str());
printf("%s %s %s \"%s\" %s %d %s %d %ld %s %s %lld\n",
printf("%s %s %s \"%s\" %s %d %s %d %ld %s %s %d\n",
c_ip.c_str(),
_date,
_time,
@@ -346,7 +347,7 @@ void CmWebLog::AddLogEntry_ELF(CyhookHandler *hh)
cs_uri.c_str(),
sc_status,
cs_method.c_str(),
(long long) bytes,
bytes,
time_taken,
time_taken_request.c_str(),
time_taken_response.c_str(),