mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 18:31:22 +02:00
Mark unused vars as comment
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@104 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -32,7 +32,7 @@ THandleStatus CmodCache::Hook_PrepareResponse(CyhookHandler *hh)
|
||||
{
|
||||
hh->status = HANDLED_NONE;
|
||||
|
||||
log_level_printf(4,"mod_cache prepare hook start url:%s\n",hh->UrlData["fullurl"].c_str());
|
||||
log_level_printf(4,"mod_cache prepare hook start url:%s\n",hh->UrlData["fullurl"].c_str());
|
||||
std::string url = hh->UrlData["fullurl"];
|
||||
if(CacheList.find(url) != CacheList.end()) // is in Cache. Rewrite URL or not modified
|
||||
{
|
||||
@@ -45,7 +45,7 @@ THandleStatus CmodCache::Hook_PrepareResponse(CyhookHandler *hh)
|
||||
struct tm mod;
|
||||
if(strptime(hh->HeaderList["If-Modified-Since"].c_str(), RFC1123FMT, &mod) != NULL)
|
||||
{
|
||||
mod.tm_isdst = 0; // daylight saving flag!
|
||||
mod.tm_isdst = 0; // daylight saving flag!
|
||||
if_modified_since = mktime(&mod); // Date given
|
||||
}
|
||||
}
|
||||
@@ -65,8 +65,8 @@ THandleStatus CmodCache::Hook_PrepareResponse(CyhookHandler *hh)
|
||||
hh->SetHeader(HTTP_NOT_MODIFIED, CacheList[url].mime_type, HANDLED_READY);
|
||||
pthread_mutex_unlock(&mutex);
|
||||
}
|
||||
log_level_printf(4,"mod_cache hook prepare end status:%d\n",(int)hh->status);
|
||||
|
||||
log_level_printf(4,"mod_cache hook prepare end status:%d\n",(int)hh->status);
|
||||
|
||||
return hh->status;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -79,7 +79,7 @@ THandleStatus CmodCache::Hook_SendResponse(CyhookHandler *hh)
|
||||
{
|
||||
hh->status = HANDLED_NONE;
|
||||
std::string url = hh->UrlData["fullurl"];
|
||||
log_level_printf(4,"mod_cache hook start url:%s\n",url.c_str());
|
||||
log_level_printf(4,"mod_cache hook start url:%s\n",url.c_str());
|
||||
|
||||
std::string category = hh->HookVarList["CacheCategory"];
|
||||
if(!(hh->HookVarList["CacheCategory"]).empty()) // Category set = cache it
|
||||
@@ -99,13 +99,13 @@ THandleStatus CmodCache::Hook_SendResponse(CyhookHandler *hh)
|
||||
else
|
||||
hh->status = HANDLED_CONTINUE; // y-calls can be implemented anywhere
|
||||
}
|
||||
log_level_printf(4,"mod_cache hook end status:%d\n",(int)hh->status);
|
||||
|
||||
log_level_printf(4,"mod_cache hook end status:%d\n",(int)hh->status);
|
||||
|
||||
return hh->status;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// HOOK: Hook_ReadConfig
|
||||
// HOOK: Hook_ReadConfig
|
||||
// This hook ist called from ReadConfig
|
||||
//-----------------------------------------------------------------------------
|
||||
THandleStatus CmodCache::Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList)
|
||||
@@ -118,10 +118,10 @@ THandleStatus CmodCache::Hook_ReadConfig(CConfigFile *Config, CStringList &Confi
|
||||
//-------------------------------------------------------------------------
|
||||
// Build and Add a cache item
|
||||
//-------------------------------------------------------------------------
|
||||
void CmodCache::AddToCache(CyhookHandler *hh, std::string url, std::string content, std::string mime_type, std::string category)
|
||||
void CmodCache::AddToCache(CyhookHandler */*hh*/, std::string url, std::string content, std::string mime_type, std::string category)
|
||||
{
|
||||
FILE *fd = NULL;
|
||||
pthread_mutex_lock(&mutex);
|
||||
pthread_mutex_lock(&mutex);
|
||||
std::string filename = cache_directory + "/" + itoa(CacheList.size()); // build cache filename
|
||||
mkdir(cache_directory.c_str(), 0777); // Create Cache directory
|
||||
if((fd = fopen(filename.c_str(),"w")) != NULL) // open file
|
||||
@@ -157,7 +157,7 @@ void CmodCache::RemoveURLFromCache(std::string url)
|
||||
void CmodCache::RemoveCategoryFromCache(std::string category)
|
||||
{
|
||||
pthread_mutex_lock(&mutex);
|
||||
bool restart = false;
|
||||
bool restart = false;
|
||||
do
|
||||
{
|
||||
restart = false;
|
||||
@@ -203,8 +203,8 @@ void CmodCache::yshowCacheInfo(CyhookHandler *hh)
|
||||
|
||||
// cache list
|
||||
yresult += string_printf("<table border=\"1\">\n");
|
||||
yresult += string_printf("<tr><td>URL</td><td>Mime</td><td>Filename</td><td>Category</td><td>Created</td><td>Remove</td></tr>\n");
|
||||
pthread_mutex_lock(&mutex);
|
||||
yresult += string_printf("<tr><td>URL</td><td>Mime</td><td>Filename</td><td>Category</td><td>Created</td><td>Remove</td></tr>\n");
|
||||
pthread_mutex_lock(&mutex);
|
||||
TCacheList::iterator i = CacheList.begin();
|
||||
for ( ; i!= CacheList.end(); i++ )
|
||||
{
|
||||
@@ -213,14 +213,14 @@ void CmodCache::yshowCacheInfo(CyhookHandler *hh)
|
||||
strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&(item->created)) );
|
||||
yresult += string_printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>" \
|
||||
"<td><a href=\"/y/cache-clear?url=%s\">url</a> " \
|
||||
"<a href=\"/y/cache-clear?category=%s\">category</a></td></tr>\n",
|
||||
((*i).first).c_str(),
|
||||
"<a href=\"/y/cache-clear?category=%s\">category</a></td></tr>\n",
|
||||
((*i).first).c_str(),
|
||||
item->mime_type.c_str(),
|
||||
item->filename.c_str(),
|
||||
item->category.c_str(),
|
||||
timeStr,
|
||||
((*i).first).c_str(),
|
||||
item->category.c_str()
|
||||
((*i).first).c_str(),
|
||||
item->category.c_str()
|
||||
);
|
||||
}
|
||||
pthread_mutex_unlock(&mutex); // Free
|
||||
@@ -253,6 +253,6 @@ void CmodCache::yCacheClear(CyhookHandler *hh)
|
||||
hh->SendHTMLHeader("Cache deletion");
|
||||
hh->WriteLn(result);
|
||||
hh->SendHTMLFooter();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -36,8 +36,8 @@
|
||||
// c) If the variant has not been modified since a valid If-
|
||||
// Modified-Since date, the server SHOULD return a 304 (Not
|
||||
// Modified) response.
|
||||
//
|
||||
// yjogol: ASSUMPTION Date-Format is ONLY RFC 1123 compatible!
|
||||
//
|
||||
// yjogol: ASSUMPTION Date-Format is ONLY RFC 1123 compatible!
|
||||
//=============================================================================
|
||||
|
||||
// system
|
||||
@@ -69,14 +69,14 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh)
|
||||
hh->status = HANDLED_NONE;
|
||||
|
||||
int filed;
|
||||
log_level_printf(4,"mod_sendfile prepare hook start url:%s\n",hh->UrlData["fullurl"].c_str());
|
||||
log_level_printf(4,"mod_sendfile prepare hook start url:%s\n",hh->UrlData["fullurl"].c_str());
|
||||
std::string mime = sendfileTypes[hh->UrlData["fileext"]];
|
||||
if(mime != "")
|
||||
{
|
||||
//TODO: Check allowed directories / actually in GetFileName
|
||||
// build filename
|
||||
std::string fullfilename = GetFileName(hh, hh->UrlData["path"], hh->UrlData["filename"]);
|
||||
|
||||
|
||||
if( (filed = OpenFile(hh, fullfilename) ) != -1 ) //can access file?
|
||||
{
|
||||
struct stat statbuf;
|
||||
@@ -98,16 +98,16 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh)
|
||||
struct tm mod;
|
||||
if(strptime(hh->HeaderList["If-Modified-Since"].c_str(), RFC1123FMT, &mod) != NULL)
|
||||
{
|
||||
mod.tm_isdst = 0; // daylight saving flag!
|
||||
mod.tm_isdst = 0; // daylight saving flag!
|
||||
if_modified_since = mktime(&mod);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// normalize obj_last_modified to GMT
|
||||
struct tm *tmp = gmtime(&(hh->LastModified));
|
||||
time_t LastModifiedGMT = mktime(tmp);
|
||||
bool modified = (if_modified_since == (time_t)-1) || (if_modified_since < LastModifiedGMT);
|
||||
|
||||
|
||||
// Send normal or not-modified header
|
||||
if(modified)
|
||||
{
|
||||
@@ -123,13 +123,13 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh)
|
||||
hh->SetError(HTTP_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
log_level_printf(4,"mod_sendfile prepare hook end status:%d\n",(int)hh->status);
|
||||
|
||||
log_level_printf(4,"mod_sendfile prepare hook end status:%d\n",(int)hh->status);
|
||||
|
||||
return hh->status;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// HOOK: Hook_ReadConfig
|
||||
// HOOK: Hook_ReadConfig
|
||||
// This hook ist called from ReadConfig
|
||||
//-----------------------------------------------------------------------------
|
||||
THandleStatus CmodSendfile::Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList)
|
||||
@@ -182,7 +182,7 @@ std::string CmodSendfile::GetFileName(CyhookHandler *hh, std::string path, std::
|
||||
//-----------------------------------------------------------------------------
|
||||
// Send File: Open File and check file type
|
||||
//-----------------------------------------------------------------------------
|
||||
int CmodSendfile::OpenFile(CyhookHandler *hh, std::string fullfilename)
|
||||
int CmodSendfile::OpenFile(CyhookHandler */*hh*/, std::string fullfilename)
|
||||
{
|
||||
int fd= -1;
|
||||
std::string tmpstring;
|
||||
@@ -209,6 +209,6 @@ std::string CmodSendfile::GetContentType(std::string ext)
|
||||
{
|
||||
ctype = MimeFileExtensions[i].mime;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ctype;
|
||||
}
|
||||
|
@@ -54,10 +54,10 @@ THandleStatus CmWebLog::Hook_EndConnection(CyhookHandler *hh)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// HOOK: Hook_ReadConfig
|
||||
// HOOK: Hook_ReadConfig
|
||||
// This hook ist called from ReadConfig
|
||||
//-----------------------------------------------------------------------------
|
||||
THandleStatus CmWebLog::Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList)
|
||||
THandleStatus CmWebLog::Hook_ReadConfig(CConfigFile *Config, CStringList &/*ConfigList*/)
|
||||
{
|
||||
LogFormat = Config->getString("mod_weblog.log_format", LOG_FORMAT);
|
||||
WebLogFilename = Config->getString("mod_weblog.logfile", LOG_FILE);
|
||||
@@ -126,18 +126,18 @@ bool CmWebLog::printf(const char *fmt, ...)
|
||||
//-----------------------------------------------------------------------------
|
||||
// CLF - Common Logfile Format
|
||||
//
|
||||
// Example: 127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
|
||||
// Example: 127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
|
||||
//
|
||||
// The common logfile format is as follows:
|
||||
// The common logfile format is as follows:
|
||||
// remotehost rfc931 authuser [date] "request" status bytes
|
||||
//
|
||||
// remotehost: Remote hostname (or IP number if DNS hostname is not available, or if DNSLookup is Off.
|
||||
// rfc931: The remote logname of the user.
|
||||
// authuser: The username as which the user has authenticated himself.
|
||||
// [date]: Date and time of the request.
|
||||
// "request": The request line exactly as it came from the client.
|
||||
// status: The HTTP status code returned to the client.
|
||||
// bytes: The content-length of the document transferred.
|
||||
// remotehost: Remote hostname (or IP number if DNS hostname is not available, or if DNSLookup is Off.
|
||||
// rfc931: The remote logname of the user.
|
||||
// authuser: The username as which the user has authenticated himself.
|
||||
// [date]: Date and time of the request.
|
||||
// "request": The request line exactly as it came from the client.
|
||||
// status: The HTTP status code returned to the client.
|
||||
// bytes: The content-length of the document transferred.
|
||||
//-----------------------------------------------------------------------------
|
||||
void CmWebLog::AddLogEntry_CLF(CyhookHandler *hh)
|
||||
{
|
||||
@@ -156,67 +156,67 @@ void CmWebLog::AddLogEntry_CLF(CyhookHandler *hh)
|
||||
std::string request_startline = hh->UrlData["startline"].c_str();
|
||||
int s_status = hh->httpStatus;
|
||||
int bytes = hh->GetContentLength();
|
||||
|
||||
|
||||
struct tm *time_now;
|
||||
time_t now = time(NULL);
|
||||
char request_time[80];
|
||||
|
||||
time_now = localtime(&now);
|
||||
strftime(request_time, 80, "[%d/%b/%Y:%H:%M:%S]", time_now);
|
||||
|
||||
printf("%s - - %s \"%s\" %d %d\n",
|
||||
|
||||
printf("%s - - %s \"%s\" %d %d\n",
|
||||
c_ip.c_str(),
|
||||
request_time,
|
||||
request_startline.c_str(),
|
||||
s_status,
|
||||
bytes);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/*
|
||||
Definition: (ELF) Extended Log File Format
|
||||
W3C Working Draft WD-logfile-960323 (http://www.w3.org/pub/WWW/TR/WD-logfile-960323.html)
|
||||
|
||||
An extended log file contains a sequence of lines containing ASCII
|
||||
characters terminated by either the sequence LF or CRLF.
|
||||
Log file generators should follow the line termination convention for
|
||||
the platform on which they are executed. Analyzers should accept either form.
|
||||
Each line may contain either a directive or an entry.
|
||||
|
||||
Entries consist of a sequence of fields relating to a single HTTP
|
||||
transaction. Fields are separated by whitespace, the use of tab characters
|
||||
for this purpose is encouraged. If a field is unused in a particular
|
||||
entry dash "-" marks the omitted field. Directives record information about
|
||||
the logging process itself.
|
||||
|
||||
Lines beginning with the # character contain directives.
|
||||
The following directives are defined:
|
||||
|
||||
- Version: <integer>.<integer>
|
||||
The version of the extended log file format used.
|
||||
This draft defines version 1.0.
|
||||
- Fields: [<specifier>...]
|
||||
Specifies the fields recorded in the log.
|
||||
- Software: string
|
||||
Identifies the software which generated the log.
|
||||
- Start-Date: <date> <time>
|
||||
The date and time at which the log was started.
|
||||
- End-Date:<date> <time>
|
||||
The date and time at which the log was finished.
|
||||
- Date:<date> <time>
|
||||
The date and time at which the entry was added.
|
||||
- Remark: <text>
|
||||
Comment information. Data recorded in this field should be
|
||||
ignored by analysis tools.
|
||||
An extended log file contains a sequence of lines containing ASCII
|
||||
characters terminated by either the sequence LF or CRLF.
|
||||
Log file generators should follow the line termination convention for
|
||||
the platform on which they are executed. Analyzers should accept either form.
|
||||
Each line may contain either a directive or an entry.
|
||||
|
||||
The directives Version and Fields are required and should precede all
|
||||
entries in the log. The Fields directive specifies the data recorded in the
|
||||
Entries consist of a sequence of fields relating to a single HTTP
|
||||
transaction. Fields are separated by whitespace, the use of tab characters
|
||||
for this purpose is encouraged. If a field is unused in a particular
|
||||
entry dash "-" marks the omitted field. Directives record information about
|
||||
the logging process itself.
|
||||
|
||||
Lines beginning with the # character contain directives.
|
||||
The following directives are defined:
|
||||
|
||||
- Version: <integer>.<integer>
|
||||
The version of the extended log file format used.
|
||||
This draft defines version 1.0.
|
||||
- Fields: [<specifier>...]
|
||||
Specifies the fields recorded in the log.
|
||||
- Software: string
|
||||
Identifies the software which generated the log.
|
||||
- Start-Date: <date> <time>
|
||||
The date and time at which the log was started.
|
||||
- End-Date:<date> <time>
|
||||
The date and time at which the log was finished.
|
||||
- Date:<date> <time>
|
||||
The date and time at which the entry was added.
|
||||
- Remark: <text>
|
||||
Comment information. Data recorded in this field should be
|
||||
ignored by analysis tools.
|
||||
|
||||
The directives Version and Fields are required and should precede all
|
||||
entries in the log. The Fields directive specifies the data recorded in the
|
||||
fields of each entry.
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
Example
|
||||
Example
|
||||
The following is an example file in the extended log format:
|
||||
|
||||
|
||||
#Version: 1.0
|
||||
#Date: 12-Jan-1996 00:00:00
|
||||
#Fields: time cs-method cs-uri
|
||||
@@ -224,75 +224,75 @@ void CmWebLog::AddLogEntry_CLF(CyhookHandler *hh)
|
||||
12:21:16 GET /foo/bar.html
|
||||
12:45:52 GET /foo/bar.html
|
||||
12:57:34 GET /foo/bar.html
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
Fields
|
||||
The #Fields directive lists a sequence of field identifiers specifying
|
||||
the information recorded in each entry. Field identifiers may have one
|
||||
Fields
|
||||
The #Fields directive lists a sequence of field identifiers specifying
|
||||
the information recorded in each entry. Field identifiers may have one
|
||||
of the following forms:
|
||||
|
||||
- identifier
|
||||
Identifier relates to the transaction as a whole.
|
||||
- prefix-identifier
|
||||
Identifier relates to information transfer between parties
|
||||
defined by the value prefix.
|
||||
- prefix(header)
|
||||
Identifies the value of the HTTP header field header for transfer
|
||||
between parties defined by the value prefix. Fields specified in
|
||||
this manner always have the value <string>.
|
||||
|
||||
- identifier
|
||||
Identifier relates to the transaction as a whole.
|
||||
- prefix-identifier
|
||||
Identifier relates to information transfer between parties
|
||||
defined by the value prefix.
|
||||
- prefix(header)
|
||||
Identifies the value of the HTTP header field header for transfer
|
||||
between parties defined by the value prefix. Fields specified in
|
||||
this manner always have the value <string>.
|
||||
|
||||
The following prefixes are defined:
|
||||
|
||||
c : Client
|
||||
s : Server
|
||||
r : Remote
|
||||
cs : Client to Server.
|
||||
sc : Server to Client.
|
||||
sr : Server to Remote Server, this prefix is used by proxies.
|
||||
rs : Remote Server to Server, this prefix is used by proxies.
|
||||
x : Application specific identifier.
|
||||
|
||||
The identifier cs-method thus refers to the method in the request
|
||||
sent by the client to the server while sc(Referer) refers to the
|
||||
referer: field of the reply. The identifier c-ip refers to the
|
||||
c : Client
|
||||
s : Server
|
||||
r : Remote
|
||||
cs : Client to Server.
|
||||
sc : Server to Client.
|
||||
sr : Server to Remote Server, this prefix is used by proxies.
|
||||
rs : Remote Server to Server, this prefix is used by proxies.
|
||||
x : Application specific identifier.
|
||||
|
||||
The identifier cs-method thus refers to the method in the request
|
||||
sent by the client to the server while sc(Referer) refers to the
|
||||
referer: field of the reply. The identifier c-ip refers to the
|
||||
client's ip address.
|
||||
|
||||
|
||||
Identifiers. (The following identifiers do not require a prefix)
|
||||
|
||||
date : Date at which transaction completed, field has type <date>
|
||||
time : Time at which transaction completed, field has type <time>
|
||||
time-taken : Time taken for transaction to complete in
|
||||
seconds, field has type <fixed>
|
||||
bytes : bytes transferred, field has type <integer>
|
||||
cached : Records whether a cache hit occurred, field
|
||||
has type <integer> 0 indicates a cache miss.
|
||||
|
||||
date : Date at which transaction completed, field has type <date>
|
||||
time : Time at which transaction completed, field has type <time>
|
||||
time-taken : Time taken for transaction to complete in
|
||||
seconds, field has type <fixed>
|
||||
bytes : bytes transferred, field has type <integer>
|
||||
cached : Records whether a cache hit occurred, field
|
||||
has type <integer> 0 indicates a cache miss.
|
||||
|
||||
Identifiers. (The following identifiers require a prefix)
|
||||
|
||||
ip : IP address and port, field has type <address>
|
||||
dns : DNS name, field has type <name>
|
||||
status : Status code, field has type <integer>
|
||||
comment : Comment returned with status code, field has type <text>
|
||||
method : Method, field has type <name>
|
||||
uri : URI, field has type <uri>
|
||||
uri-stem : Stem portion alone of URI (omitting query), field has type <uri>
|
||||
uri-query : Query portion alone of URI, field has type <uri>
|
||||
|
||||
Special fields for log summaries.
|
||||
|
||||
ip : IP address and port, field has type <address>
|
||||
dns : DNS name, field has type <name>
|
||||
status : Status code, field has type <integer>
|
||||
comment : Comment returned with status code, field has type <text>
|
||||
method : Method, field has type <name>
|
||||
uri : URI, field has type <uri>
|
||||
uri-stem : Stem portion alone of URI (omitting query), field has type <uri>
|
||||
uri-query : Query portion alone of URI, field has type <uri>
|
||||
|
||||
Special fields for log summaries.
|
||||
Analysis tools may generate log summaries. A log summary entry begins with a count specifying the number of times a particular even occurred. For example a site may be interested in a count of the number of requests for a particular URI with a given referer: field but not be interested in recording information about individual requests such as the IP address.
|
||||
|
||||
|
||||
The following field is mandatory and must precede all others:
|
||||
|
||||
count
|
||||
The number of entries for which the listed data, field has type <integer>
|
||||
|
||||
count
|
||||
The number of entries for which the listed data, field has type <integer>
|
||||
The following fields may be used in place of time to allow aggregation of log file entries over intervals of time.
|
||||
|
||||
time-from
|
||||
Time at which sampling began, field has type <time>
|
||||
time-to
|
||||
Time at which sampling ended, field has type <time>
|
||||
interval
|
||||
Time over which sampling occurred in seconds, field has type <integer>
|
||||
|
||||
time-from
|
||||
Time at which sampling began, field has type <time>
|
||||
time-to
|
||||
Time at which sampling ended, field has type <time>
|
||||
interval
|
||||
Time over which sampling occurred in seconds, field has type <integer>
|
||||
-----------------------------------------------------------------------------
|
||||
actual Implementation:
|
||||
|
||||
@@ -307,7 +307,7 @@ void CmWebLog::AddLogEntry_CLF(CyhookHandler *hh)
|
||||
time-taken
|
||||
x-time-request
|
||||
x-time-response
|
||||
cached
|
||||
cached
|
||||
*/
|
||||
|
||||
void CmWebLog::AddLogEntry_ELF(CyhookHandler *hh)
|
||||
@@ -330,7 +330,7 @@ void CmWebLog::AddLogEntry_ELF(CyhookHandler *hh)
|
||||
int sc_status = hh->httpStatus;
|
||||
int bytes = hh->GetContentLength();
|
||||
int cached = (hh->HookVarList["CacheCategory"].empty()) ? 0 : 1;
|
||||
|
||||
|
||||
struct tm *time_now;
|
||||
time_t now = time(NULL);
|
||||
time_now = localtime(&now);
|
||||
@@ -344,11 +344,11 @@ void CmWebLog::AddLogEntry_ELF(CyhookHandler *hh)
|
||||
char _time[11];
|
||||
strftime(_time, 11, "%H:%M:%S", time_now);
|
||||
|
||||
std::string time_taken_request = hh->HookVarList["enlapsed_request"];
|
||||
std::string time_taken_request = hh->HookVarList["enlapsed_request"];
|
||||
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 %d\n",
|
||||
printf("%s %s %s \"%s\" %s %d %s %d %ld %s %s %d\n",
|
||||
c_ip.c_str(),
|
||||
_date,
|
||||
_time,
|
||||
@@ -362,4 +362,4 @@ void CmWebLog::AddLogEntry_ELF(CyhookHandler *hh)
|
||||
time_taken_response.c_str(),
|
||||
cached
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -80,7 +80,7 @@ THandleStatus CyParser::Hook_SendResponse(CyhookHandler *hh)
|
||||
{
|
||||
hh->status = HANDLED_NONE;
|
||||
|
||||
// log_level_printf(4,"yparser hook start url:%s\n",hh->UrlData["url"].c_str());
|
||||
// log_level_printf(4,"yparser hook start url:%s\n",hh->UrlData["url"].c_str());
|
||||
init(hh);
|
||||
|
||||
CyParser *yP = new CyParser(); // create a Session
|
||||
@@ -94,9 +94,9 @@ THandleStatus CyParser::Hook_SendResponse(CyhookHandler *hh)
|
||||
}
|
||||
delete yP;
|
||||
|
||||
// log_level_printf(4,"yparser hook end status:%d\n",(int)hh->status);
|
||||
// log_level_printf(5,"yparser hook result:%s\n",hh->yresult.c_str());
|
||||
|
||||
// log_level_printf(4,"yparser hook end status:%d\n",(int)hh->status);
|
||||
// log_level_printf(5,"yparser hook result:%s\n",hh->yresult.c_str());
|
||||
|
||||
return hh->status;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ void CyParser::Execute(CyhookHandler *hh)
|
||||
int index = -1;
|
||||
std::string filename = hh->UrlData["filename"];
|
||||
|
||||
log_level_printf(4,"yParser.Execute filename%s\n",filename.c_str());
|
||||
log_level_printf(4,"yParser.Execute filename%s\n",filename.c_str());
|
||||
filename = string_tolower(filename);
|
||||
|
||||
// debugging informations
|
||||
@@ -151,7 +151,7 @@ void CyParser::Execute(CyhookHandler *hh)
|
||||
{
|
||||
(this->*yCgiCallList[index].pfunc)(hh);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@@ -535,7 +535,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd)
|
||||
// Get Value from ini/conf-file (filename) for var (varname)
|
||||
// yaccess = open | cache
|
||||
//-------------------------------------------------------------------------
|
||||
std::string CyParser::YWeb_cgi_get_ini(CyhookHandler *hh, std::string filename, std::string varname, std::string yaccess)
|
||||
std::string CyParser::YWeb_cgi_get_ini(CyhookHandler */*hh*/, std::string filename, std::string varname, std::string yaccess)
|
||||
{
|
||||
std::string result;
|
||||
if((yaccess == "open") || (yaccess == ""))
|
||||
@@ -551,7 +551,7 @@ std::string CyParser::YWeb_cgi_get_ini(CyhookHandler *hh, std::string filename,
|
||||
// set Value from ini/conf-file (filename) for var (varname)
|
||||
// yaccess = open | cache | save
|
||||
//-------------------------------------------------------------------------
|
||||
void CyParser::YWeb_cgi_set_ini(CyhookHandler *hh, std::string filename, std::string varname, std::string varvalue, std::string yaccess)
|
||||
void CyParser::YWeb_cgi_set_ini(CyhookHandler */*hh*/, std::string filename, std::string varname, std::string varvalue, std::string yaccess)
|
||||
{
|
||||
std::string result;
|
||||
if((yaccess == "open") || (yaccess == ""))
|
||||
@@ -576,7 +576,7 @@ std::string CyParser::YWeb_cgi_include_block(std::string filename, std::string
|
||||
yresult = ydefault;
|
||||
|
||||
stat(filename.c_str(), &attrib);
|
||||
|
||||
|
||||
pthread_mutex_lock( &yParser_mutex );
|
||||
if( (attrib.st_mtime == yCached_blocks_attrib.st_mtime) && (filename == yCached_blocks_filename) )
|
||||
{
|
||||
@@ -632,7 +632,7 @@ std::string CyParser::YWeb_cgi_include_block(std::string filename, std::string
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
std::string CyParser::YexecuteScript(CyhookHandler *hh, std::string cmd)
|
||||
std::string CyParser::YexecuteScript(CyhookHandler */*hh*/, std::string cmd)
|
||||
{
|
||||
std::string script, para, result;
|
||||
bool found = false;
|
||||
@@ -687,7 +687,7 @@ std::string CyParser::YexecuteScript(CyhookHandler *hh, std::string cmd)
|
||||
|
||||
//=============================================================================
|
||||
// y-func : Dispatching
|
||||
// TODO: new functions for
|
||||
// TODO: new functions for
|
||||
// - Compiler-Time Settings like *httpd.conf etc
|
||||
// - Versions of httpd, yParser, Hooks,
|
||||
//=============================================================================
|
||||
@@ -755,7 +755,7 @@ std::string CyParser::func_get_config_data(CyhookHandler *hh, std::string para)
|
||||
//-------------------------------------------------------------------------
|
||||
extern void yhttpd_reload_config();
|
||||
|
||||
std::string CyParser::func_do_reload_httpd_config(CyhookHandler *hh, std::string para)
|
||||
std::string CyParser::func_do_reload_httpd_config(CyhookHandler */*hh*/, std::string /*para*/)
|
||||
{
|
||||
log_level_printf(1,"func_do_reload_httpd_config: raise USR1 !!!\n");
|
||||
//raise(SIGUSR1); // Send HUP-Signal to Reload Settings
|
||||
|
Reference in New Issue
Block a user