aboutsummaryrefslogtreecommitdiff
path: root/src/sql.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql.c')
-rw-r--r--src/sql.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sql.c b/src/sql.c
index c42c5de..3acd9de 100644
--- a/src/sql.c
+++ b/src/sql.c
@@ -1,5 +1,5 @@
1/* This file is part of vmod-dbrw 1/* This file is part of vmod-dbrw
2 Copyright (C) 2013-2014 Sergey Poznyakoff 2 Copyright (C) 2013-2018 Sergey Poznyakoff
3 3
4 Vmod-dbrw is free software; you can redistribute it and/or modify 4 Vmod-dbrw is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -143,6 +143,7 @@ sql_query(struct dbrw_connection *conn, const char *input)
143 return 1; 143 return 1;
144 } 144 }
145 } while (conn->state != state_connected); 145 } while (conn->state != state_connected);
146 conn->timestamp = time(NULL);
146 if (conn->conf->backend->sql_query(conn, input) == 0) 147 if (conn->conf->backend->sql_query(conn, input) == 0)
147 return 0; 148 return 0;
148 return 1; 149 return 1;
@@ -185,3 +186,11 @@ sql_get_column(struct dbrw_connection *conn, unsigned row, unsigned col)
185 return conn->conf->backend->sql_get_column(conn, row, col); 186 return conn->conf->backend->sql_get_column(conn, row, col);
186} 187}
187 188
189int
190sql_idle_timeout(struct dbrw_connection *conn)
191{
192 CONN_ASSERT_VAL(conn, -1);
193 if (!conn->conf->backend->sql_idle_timeout)
194 return -1;
195 return conn->conf->backend->sql_idle_timeout(conn);
196}

Return to:

Send suggestions and report system problems to the System administrator.