summaryrefslogtreecommitdiff
path: root/src/mod_vhostdb_mysql.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-11-25 01:54:08 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2020-07-08 19:54:28 -0400
commit010c28949c17f3a846d78e4938ae53f165b6b3f1 (patch)
tree19423195330404ccb34456b87fa4e4f93d0f9708 /src/mod_vhostdb_mysql.c
parent644725127f029b9e8b5a4b5c0d64867243f788c5 (diff)
downloadlighttpd-git-010c28949c17f3a846d78e4938ae53f165b6b3f1.tar.gz
[multiple] prefer (connection *) to (srv *)
convert all log_error_write() to log_error() and pass (log_error_st *) use con->errh in preference to srv->errh (even though currently same) avoid passing (server *) when previously used only for logging (errh)
Diffstat (limited to 'src/mod_vhostdb_mysql.c')
-rw-r--r--src/mod_vhostdb_mysql.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mod_vhostdb_mysql.c b/src/mod_vhostdb_mysql.c
index 766ee8e9..5f66c35c 100644
--- a/src/mod_vhostdb_mysql.c
+++ b/src/mod_vhostdb_mysql.c
@@ -82,8 +82,8 @@ static int mod_vhostdb_dbconf_setup (server *srv, const array *opts, void **vdat
vhostdb_config *dbconf;
MYSQL *dbconn = mysql_init(NULL);
if (NULL == dbconn) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "mysql_init() failed, exiting...");
+ log_error(srv->errh, __FILE__, __LINE__,
+ "mysql_init() failed, exiting...");
return -1;
}
@@ -103,8 +103,7 @@ static int mod_vhostdb_dbconf_setup (server *srv, const array *opts, void **vdat
#endif
if (!mysql_real_connect(dbconn, host, user, pass, dbname, port, sock,
CLIENT_MULTI_STATEMENTS)) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- mysql_error(dbconn));
+ log_error(srv->errh, __FILE__, __LINE__, "%s", mysql_error(dbconn));
mysql_close(dbconn);
return -1;
}
@@ -124,6 +123,7 @@ static void mod_vhostdb_patch_config (connection * const con, plugin_data * cons
static int mod_vhostdb_mysql_query(server *srv, connection *con, void *p_d, buffer *docroot)
{
+ UNUSED(srv);
plugin_data *p = (plugin_data *)p_d;
vhostdb_config *dbconf;
unsigned cols;
@@ -157,8 +157,8 @@ static int mod_vhostdb_mysql_query(server *srv, connection *con, void *p_d, buff
}
if (mysql_real_query(dbconf->dbconn, CONST_BUF_LEN(sqlquery))) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- mysql_error(dbconf->dbconn));
+ log_error(con->conf.errh, __FILE__, __LINE__, "%s",
+ mysql_error(dbconf->dbconn));
buffer_clear(docroot); /*(reset buffer; no result)*/
return -1;
}