path: root/src/dbrw.h
AgeCommit message (Collapse)AuthorFiles
3 daysDrop support for Varnish versions prior to 6.0HEADmasterSergey Poznyakoff1
7 daysRestore backward compatibility with <6.2Sergey Poznyakoff1
2019-02-13Implement two new flags and a special req.http header to indicate errorsSergey Poznyakoff1
* NEWS: Document changes. * doc/vmod-dbrw.3: Likewise. * doc/vmod-dbrw.texi: Likewise. * Version 2.4.90 * src/dbrw.h (dbrw_config): New member: match_type * src/vmod_dbrw.c (parse_flags): Handle "eq" and "regex" flags. (findmatch): Handle the "eq" flag. (do_rewrite): Return error code. (vmod_rewrite): Set the X-VMOD-DBRW-Error header on errors. * tests/ (at_vcl_backend): Special handling for X-VMOD-DBRW-Error. * tests/ Test the 'eq' flag. * tests/ New testcase. * tests/ Add new testcase. * tests/ Likewise.
2018-12-10Version 2.4; Support for varnish 6.0.2release-2.4Sergey Poznyakoff1
2018-01-31Minor fixSergey Poznyakoff1
* src/dbrw.h (dbrw_backend.sql_get_column): Fix prototype.
2018-01-30Introduce connection idle timeout.Sergey Poznyakoff1
* NEWS: Updated. * Version 2.2.90 * doc/vmod-dbrw.3: Document connection idle timeout. * doc/vmod-dbrw.texi: Likewise. * src/dbrw.h (dbrw_backend) <sql_idle_timeout>: New method. (dbrw_config)<idle_timeout>: New member. (dbrw_connection)<timestamp>: New member. (sql_idle_timeout): New proto. * src/mysql.c (vmod_mysql_data) <mysql>: Change storage. All uses changed. (s_mysql_idle_timeout): New function. * src/sql.c (sql_idle_timeout): New function. (sql_query): Update connection timestamp. (sql_idle_timeout): New function. * src/vmod_dbrw.c (dbrw_connection_get): Force disconnect if connection remained idle for too long. Initialize cfg->idle_timeout. (vmod_config): New parameter 'timeout='
2017-08-05Switch to new acvmod. Remove the --with-varnish-source option. Fix the ↵Sergey Poznyakoff1
2016-04-21Rewrite SQL configuration support.Sergey Poznyakoff1
Multiple configurations can be provided, by calling dbrw.config from branches of a conditional VCL statement. The only requirement is that exactly one dbrw.config is executed within a single HTTP session. This allows the user to select rewrite data from various databases depending on some conditions. Open SQL connections are stored in a pool and reused as needed. So far no limit on the number of connections is imposed. This is a TODO. Connections remain open during the lifetime of the module (i.e. for as long as varnish is not restarted). * src/dbrw.h (dbrw_config): New members: param_str, magic and list. (dbrw_connection): New members: magic, busy, list. * src/vmod_dbrw.c (dbrw_connection_get) (dbrw_connection_release): New functions. (dbrw_event): Install atexit function. (vmod_config): Keep a pool of configurations. (dbrw_sethdr) [VARNISHVERSION]: Remove leftover code. (vmod_rewrite): Rewrite. * src/vmod_dbrw.vcc (config, rewrite): Mark as PRIV_TASK. * doc/vmod-dbrw.3: Update docs. * doc/vmod-dbrw.texi: Update docs. * Raise version number
2014-11-11Add test suite.Sergey Poznyakoff1
* Add tests subdir * Initialize testsuite. (DBRW_TEST_PARAMS,DBRW_TEST_SERVER) (DBRW_TEST_NAME,DBRW_TEST_USER) (DBRW_TEST_PASS,DBRW_TEST_DEBUG): New variables. * src/ (noinst_LTLIBRARIES): New library * src/dbrw.h (dbrw_backend_select): New proto. * src/be.c: New file. * src/mysql.c (check_errno): Add default clause. * src/vmod_dbrw.c (expand_backref): Fix memory deallocation error. (dbrw_sethdr): New function. (findmatch): Use dbrw_sethdr to set X-VMOD-DBRW-Status * tests/.gitignore: New file. * tests/initdb.c: New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ New file.
2014-10-31Update copyright yearsSergey Poznyakoff1
2013-07-20Use vmod-dbrw (with a dash) as the canonical project name.Sergey Poznyakoff1
2013-07-18Remove leftover static data.Sergey Poznyakoff1
* src/dbrw.h (dbrw_connection) <matches,matchsize>: New members. * src/vmod_dbrw.c (matches,matchsize): Remove static data. (findmatch): Update accrodingly.
2013-07-13Add copyleft headers.Sergey Poznyakoff1
2013-07-12Optional flags modify the regexp handling, return status and query disposition.Sergey Poznyakoff1
The flags can be supplied globally, using the "flags=X" parameter to drw.config, or for each record individually, by returning X in the fourth column of a tuple. In both cases X is a comma-separated list of: NC or nocase - force case-insensitive regexps case - force case-sensitive regexps (the default) QSA or qsappend - treat destination field as URL; append any query string from the original request URL to it QSD or qsdiscard - treat destination field as URL; discard any query string attached to the incoming URI R=NNN or redirect=NNN - on success, set the X-VMOD-DBRW-Status header to NNN, which must be a valid HTTP status code. * src/dbrw.h [HTTP_STATUS_LEN]: New define. <dbrw_config> (qdisp, regflags, status): New members. * src/vmod_dbrw.c (QDISP_NONE, QDISP_APPEND) (QDISP_APPEND): New constants. (dbrw_init): Fill allocated memory with zeroes. (is_http_status,parse_flags): New static functions. (vmod_config): Re-initialize conf on failure. Initialize new members of struct dbrw_config. (expand_backref): Additional argument 'qry' supplies the query part to be appended to the resulting string. (findmatch): Accept four fields per tuple, the optional fourth one supplying flags.
2013-07-12Initial commitSergey Poznyakoff1

Return to:

Send suggestions and report system problems to the System administrator.