- From: "Xavier Beaudouin" <kiwi AT cvs.caudiumforge.net>
- To: caudium-commits AT caudium.net
- Subject: CVS: caudium/server/modules/vhs vhs_sqllogger.pike,1.1.2.4,1.1.2.5
- Date: Thu, 31 Mar 2005 11:54:14 +0000
Update of /cvs/caudium/caudium/server/modules/vhs
In directory cvs.caudiumforge.net:/tmp/cvs-serv64385
Modified Files:
Tag: stable_1_2
vhs_sqllogger.pike
Log Message:
Fixing hostnames that have ":portnumber" at the end (many thnaks for wget 1.5
that is always doing that......)
Index: vhs_sqllogger.pike
===================================================================
RCS file: /cvs/caudium/caudium/server/modules/vhs/Attic/vhs_sqllogger.pike,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- vhs_sqllogger.pike 27 Feb 2005 17:00:28 -0000 1.1.2.4
+++ vhs_sqllogger.pike 31 Mar 2005 11:54:12 -0000 1.1.2.5
@@ -19,7 +19,7 @@
*
*/
/*
- * $Id: vhs_sqllogger.pike,v 1.1.2.4 2005/02/27 17:00:28 kiwi Exp $
+ * $Id: vhs_sqllogger.pike,v 1.1.2.5 2005/03/31 11:54:12 kiwi Exp $
*/
#include <module.h>
@@ -35,7 +35,7 @@
"apache distribution.";
constant module_unique= 1;
constant thread_safe = 1;
-constant cvs_version = "$Id: vhs_sqllogger.pike,v 1.1.2.4 2005/02/27
17:00:28 kiwi Exp $";
+constant cvs_version = "$Id: vhs_sqllogger.pike,v 1.1.2.5 2005/03/31
11:54:12 kiwi Exp $";
//
//! module: SQL logger
@@ -45,7 +45,7 @@
//! inherits: module
//! inherits: caudiumlib
//! type: MODULE_LOGGER
-//! cvs_version: $Id: vhs_sqllogger.pike,v 1.1.2.4 2005/02/27 17:00:28 kiwi
Exp $
+//! cvs_version: $Id: vhs_sqllogger.pike,v 1.1.2.5 2005/03/31 11:54:12 kiwi
Exp $
//
object db; // The db stack
@@ -147,7 +147,7 @@
}
void log(object id, mapping file) {
- string log_query, referer;
+ string log_query, referer, host;
array auth;
object sql_conn=db->handle();
@@ -156,7 +156,11 @@
if (!sizeof(referer)) referer = "-";
-
+ host = (string)id->misc->host;
+ if(search(host,":")) {
+ host = (host / ":")[0];
+ }
+
log_query=sprintf("INSERT INTO %s
(agent,bytes_sent,referer,remote_host,remote_user,"
"request_duration,request_method,request_protocol,"
"request_uri,request_args,status,time_stamp,virtual_host) VALUES("
@@ -173,7 +177,7 @@
id->query?sprintf("'?%s'",(string)id->query):"NULL",
(int)(file->error||200),
time(),
- (string)id->misc->host,
+ host,
);
// perror("SQL %s\n",log_query);
- CVS: caudium/server/modules/vhs vhs_sqllogger.pike,1.1.2.4,1.1.2.5, Xavier Beaudouin
Archive powered by MhonArc 2.6.10.