2019-02-15  Automatically generated  <gray@gnu.org>

	HEAD a3e4314631601e98d63a9b702cb31931ec5222b3.

2019-02-15  Sergey Poznyakoff  <gray@gnu.org>

	Version 2.5.

2019-02-15  Sergey Poznyakoff  <gray@gnu.org>

	Improve error handling in mysql.c.

	* src/mysql.c (check_errno): Always print the failed query in
	full. Don't treat ER_PARSE_ERROR and ER_EMPTY_QUERY as fatal
	errors.

2019-02-13  Sergey Poznyakoff  <gray@gnu.org>

	Implement two new flags and a special req.http header to
	indicate errors.

	* NEWS: Document changes.
	* doc/vmod-dbrw.3: Likewise.
	* doc/vmod-dbrw.texi: Likewise. 
	* configure.ac: 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/atlocal.in (at_vcl_backend): Special handling for
	X-VMOD-DBRW-Error.
	* tests/initdb.at: Test the 'eq' flag.
	* tests/rewrite07.at: New testcase.
	* tests/Makefile.am: Add new testcase.
	* tests/testsuite.at: Likewise.

2018-12-10  Sergey Poznyakoff  <gray@gnu.org>

	Fix section number in doc/vmod-dbrw.3.

2018-12-10  Sergey Poznyakoff  <gray@gnu.org>

	Update README.

2018-12-10  Sergey Poznyakoff  <gray@gnu.org>

	Version 2.4; Support for varnish 6.0.2.

2018-12-08  Sergey Poznyakoff  <gray@gnu.org>

	Version 2.3.

	* configure.ac: Bump version number.
	* NEWS: Describe new version.
	* doc/vmod-dbrw.3: Update version number.
	* doc/vmod-dbrw.texi: Document expansions.

2018-12-08  Sergey Poznyakoff  <gray@gnu.org>

	Implement the $(urlprefixes) built-in function.

	* NEWS: Update.
	* README: Update.
	* configure.ac: Version 2.2.91
	* doc/vmod-dbrw.3: Document the use of $(urlprefixes) built-in
	* doc/vmod-dbrw.texi: Likewise.
	* src/vmod_dbrw.c (parse_flags): Make sure status string is
	null-terminated.
	(do_rewrite): Expand built-in functions in $(). Support
	urlprefixes. On debug_level=100, produce detailed trace of
	expansions.
	* src/wordsplit.c: Pull from grecs commit 9097d529.
	* src/wordsplit.h: Likewise.
	* tests/initdb.at (rewrite): Change the url column.
	* tests/rewrite01.at: Use $(urlprefixes) in the SQL templates.
	* tests/rewrite02.at: Likewise.
	* tests/rewrite03.at: Likewise.
	* tests/rewrite04.at: Likewise.
	* tests/rewrite05.at: Likewise.
	* tests/rewrite06.at: Likewise.

2018-01-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* src/dbrw.h (dbrw_backend.sql_get_column): Fix prototype.

2018-01-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Introduce connection idle timeout.

	* NEWS: Updated.
	* configure.ac: 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-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update acvmod to suppresss spurious warning message.

2017-08-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Support for varnish 5.1.

	* configure.ac: Set version 2.2
	(AC_VMOD_BASENAME): New subst variable.
	* NEWS: Document changes.
	* README: Document changes.
	* acvmod: Updated.
	* tests/Makefile.am: Define AT_VMOD_BASENAME in package.m4
	* tests/atlocal.in (at_vcl_backend): Start vtc with
	varnsishtest stanza

2017-08-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix doc generator settings.

2017-08-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 2.1.

2017-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix README.

2017-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Switch to new acvmod. Remove the --with-varnish-source option.
	Fix the testsuite.

2017-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Switch to new acvmod. Remove the --with-varnish-source option.
	Fix the testsuite.

2017-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

2016-04-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rewrite SQL configuration support.

	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. 
	* configure.ac: Raise version number

2016-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix typo in NEWS.

2016-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Varnish 4.1.

	* .gitmodules: New file.
	* acvmod: New submodule.
	* bootstrap: Update.
	* Makefile.am (ACLOCAL_AMFLAGS): Add acvmod
	* configure.ac: Use AM_VARNISHAPI instead of inlining the
	related code. Enable silent rules. Set version number
	2.0.90-4.1.0
	* src/Makefile.am: Enable silent rules.
	* tests/Makefile.am: Likewise.
	* tests/atlocal.in (at_vcl_backend): Remove conditional. 
	* src/vmod_dbrw.c: Use event function.
	* src/vmod_dbrw.vcc: Likewise. 
	* NEWS: Document changes.

2015-04-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix doc generation.

	Default Config file applied to all output formats, which is
	wrong. Use a dedicated configuration file for html output
	formats, and defaults for the rest.

	* doc/Makefile.am (GENDOCS): Add html-specific configuration
	file.
	* doc/Config: Rename to doc/html.init (with changes).

2015-03-01  Sergey Poznyakoff  <gray@gnu.org>

	Switch to Texinfo 5.0.

	* doc/Config: Rewrite.
	* doc/Makefile.am: Use Makeinfo 5 instead of texi2htm
	* doc/gendocs_template: Ps is not built
	* imprimatur: Upgrade.

2015-02-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix Varnish 3 compatibility.

	* src/vmod_dbrw.c (WS_Copy): Fix definition.

2014-11-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 2.0.

2014-11-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve docs and testsuite.

	* NEWS: Update.
	* README: Update.
	* configure.ac: Update.
	* tests/initdb.at: Remove mysql-specific statements.
	* tests/initdb.c (trycreate, main): Rewrite postgres-specific
	parts.
	* tests/testsuite.at (AT_DBINIT_PREREQ): Throw xfail if
	FAILFILE exists. Exit immediately in that case.

2014-11-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update the docs for VCL 4.0.

2014-11-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update README.

2014-11-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update docs.  Rename DBRW_TEST_NAME to DBRW_TEST_DATABASE.

2014-11-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve the testsuite.

	New macro AT_DBRW_INIT ensures the test database is
	initialized. When finished, it creates the file .TESTINIT if
	the initialization succeeded or FAILURE, if it did not. The
	latter contains the error output from initdb. These files are
	then used to decide whether to proceed with the tests.

	All tests include this macro at the very beginning.

	* tests/Makefile.am (CLEANFILES): Add files.
	* tests/atlocal.in (INITFILE, FAILFILE): New variables.
	* tests/initdb.at: Rewrite as a new define AT_DBRW_INITDB.
	* tests/exact01.at: Include AT_DBRW_INIT at the start, Use
	AT_DBINIT_PREREQ
	* tests/testsuite.at (AT_DBRW_INIT, AT_DBINIT_PREREQ): New
	macros.
	* tests/rewrite01.at: Likewise.
	* tests/rewrite02.at: Likewise.
	* tests/rewrite03.at: Likewise.
	* tests/rewrite04.at: Likewise.
	* tests/rewrite05.at: Likewise.
	* tests/rewrite06.at: Likewise.

2014-11-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add test suite.

	* Makefile.am: Add tests subdir
	* configure.ac: Initialize testsuite.
	(DBRW_TEST_PARAMS,DBRW_TEST_SERVER)
	(DBRW_TEST_NAME,DBRW_TEST_USER)
	(DBRW_TEST_PASS,DBRW_TEST_DEBUG): New variables.
	* src/Makefile.am (noinst_LTLIBRARIES): New library libsql.la
	* 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/Makefile.am: New file.
	* tests/atlocal.in: New file.
	* tests/exact01.at: New file.
	* tests/initdb.at: New file.
	* tests/rewrite01.at: New file.
	* tests/rewrite02.at: New file.
	* tests/rewrite03.at: New file.
	* tests/rewrite04.at: New file.
	* tests/rewrite05.at: New file.
	* tests/rewrite06.at: New file.
	* tests/testsuite.at: New file.

2014-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Report version of varnish at the end of configure.

2014-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update copyright years.

2014-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor change.

2014-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update copyright years.

2014-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Build for both v3 and v4.

	* NEWS: Update version number.
	* configure.ac: Version 1.9.90
	(VARNISHVERSION): New variable.
	(VARNISH3,VARNISH4): New conditionals.
	* src/Makefile.am (nodist_libvmod_dbrw_la_SOURCES): New
	variable.
	(vmodtool,vmodtoolargs,vccfile): Define depending on Varnish
	version.
	(.vcc.vcc3): New rule
	(vcc_if.c vcc_if.h): Depend on $(vccfile) Don't distribute
	vcc_if.c and vcc_if.h.
	* src/vmod_dbrw.c: Provide data types and access macros
	depending on the version of Varnish.

2014-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Initial rewrite for Varnish 4.x.

	* configure.ac: Check for include/vapi/vsm.h in varnish source
	tree. Change version number to 1.0.91-vcl4
	* NEWS: Update version number.
	* src/Makefile.am (AM_CPPFLAGS): Add $(VARNISHSRC)/bin/varnishd
	(vmodtool,vmodtoolargs): New variables.
	(vcc_if.c vcc_if.h): Rewrite the rule.
	* src/vmod_dbrw.c: Include pthread.h Change path to cache.h
	(vmod_config,vmod_rewrite): Change declaration.
	(expand_backref,findmatch): Change declaration. Use WS_Copy
	instead of WS_Dup.
	* src/vmod_dbrw.vcc: Rewrite.

2014-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update version number.

2013-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Get rid of the --with-vmod-dir option.

	* Makefile.am: Add default options for distcheck.
	* configure.ac: Remove --with-vmod-dir, default to the standard
	Varnish module location, Provide the --without-vmoddir option
	for use in distcheck.

2013-09-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* src/mysql.c (check_errno): Improve diagnostics.
	(s_mysql_query): Set state depending on the result of the
	operation and on whether it is supposed to return tuples.
	* src/pgsql.c (s_pgsql_query): Likewise.
	* src/sql.c (sql_query): Backend is responsible for switching
	states.
	* src/vmod_dbrw.c (vmod_config): Don't call atoi with NULL
	argument.

2013-07-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Use EX/EE for examples in the manpage.

2013-07-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve manpage.

2013-07-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Changes in documentation.

	* doc/gendocs_template: Add a link to man page
	* doc/vmod-dbrw.3: Add optional download section.

2013-07-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix typos.

2013-07-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Use vmod-dbrw (with a dash) as the canonical project name.

2013-07-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add auxiliary files for HTML doc genereation.

2013-07-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Write the Texinfo documentation.

	* doc/vmod_dbrw.texi: Write docs.
	* doc/.gitignore: Update.
	* doc/vmod_dbrw.3: Update.

2013-07-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove leftover static data.

	* src/dbrw.h (dbrw_connection) <matches,matchsize>: New
	members.
	* src/vmod_dbrw.c (matches,matchsize): Remove static data.
	(findmatch): Update accrodingly.

2013-07-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add a framework for Texinfo documentation.

	* bootstrap: Don't overwrite existing ChangeLog
	* doc/.gitignore: New file.
	* doc/Makefile.am: Update.
	* doc/vmod_dbrw.texi: New file.
	* doc/fdl.texi: New file.

2013-07-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Various fixes.

	* doc/vmod_dbrw.3: Update.
	* src/Makefile.am: Add BUILT_SOURCES.

2013-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix the copyleft statement.

2013-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add the documentation.

	* Makefile.am (SUBDIRS): Add doc.
	* configure.ac: Build doc/Makefile.
	* doc/Makefile.am: New file.
	* doc/vmod_dbrw.3: New file. 
	* src/vmod_dbrw.c (vmod_rewrite): Minor change.

2013-07-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* src/mysql.c (s_mysql_connect): If unable to connect, issue an
	error message.
	* src/vmod_dbrw.c (expand_backref): Rewrite memory management
	part.

2013-07-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix PostgreSQL detection in configure.ac.

2013-07-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add PostgreSQL support.

2013-07-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* src/sql.c (sql_connect): Act in accordance with the current
	state.

2013-07-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* src/vmod_dbrw.c (get_connection): Save connection pointer as
	thread-specific data.

2013-07-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add copyleft headers.

2013-07-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Lint.

2013-07-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor change.

2013-07-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Optional flags modify the regexp handling, return status and
	query disposition.

	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-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Initial commit.


Local Variables:
mode: change-log
version-control: never
buffer-read-only: t
End:
