diff options
Diffstat (limited to 'src/sql.c')
-rw-r--r-- | src/sql.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,5 +1,5 @@ /* This file is part of vmod-dbrw - Copyright (C) 2013-2014 Sergey Poznyakoff + Copyright (C) 2013-2018 Sergey Poznyakoff Vmod-dbrw is free software; you can redistribute it and/or modify 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) return 1; } } while (conn->state != state_connected); + conn->timestamp = time(NULL); if (conn->conf->backend->sql_query(conn, input) == 0) return 0; return 1; @@ -185,3 +186,11 @@ sql_get_column(struct dbrw_connection *conn, unsigned row, unsigned col) return conn->conf->backend->sql_get_column(conn, row, col); } +int +sql_idle_timeout(struct dbrw_connection *conn) +{ + CONN_ASSERT_VAL(conn, -1); + if (!conn->conf->backend->sql_idle_timeout) + return -1; + return conn->conf->backend->sql_idle_timeout(conn); +} |