aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-01-20 14:40:13 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-01-20 14:40:13 +0200
commit6f72ce19982bd6f7eb9cfe7c2ebcbc221063401d (patch)
tree522208d44816d8a8bdd9298d1fe7284dbf9267c4
parent741817ac5372c374b52b710dd8a4b0cc463ade99 (diff)
downloadvmod-tbf-6f72ce19982bd6f7eb9cfe7c2ebcbc221063401d.tar.gz
vmod-tbf-6f72ce19982bd6f7eb9cfe7c2ebcbc221063401d.tar.bz2
Rewrite for varnishapi 4.1varnish-4.1
* NEWS: Update. * configure.ac: Raise version number to 2.0.90 * src/tbf.c (tbf_init): Replaced with tbf_event * src/vmod_tbf.vcc: Likewise. * src/tbf.h: Include errno.h and vcl.h.
-rw-r--r--NEWS7
-rw-r--r--configure.ac2
-rw-r--r--src/tbf.c9
-rw-r--r--src/tbf.h4
-rw-r--r--src/vmod_tbf.vcc2
5 files changed, 17 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index b87dafa..f324433 100644
--- a/NEWS
+++ b/NEWS
@@ -1,13 +1,18 @@
1vmod-tbf -- history of user-visible changes. 2014-11-13 1vmod-tbf -- history of user-visible changes. 2016-01-20
2Copyright (C) 2013-2014 Sergey Poznyakoff 2Copyright (C) 2013-2014 Sergey Poznyakoff
3See the end of file for copying conditions. 3See the end of file for copying conditions.
4 4
5Please send vmod-tbf bug reports to <gray@gnu.org> 5Please send vmod-tbf bug reports to <gray@gnu.org>
6 6
7 7
8Version 2.1, (git)
9
10Support for Varnishapi 4.1
11
12
8Version 2.0, 2014-11-13 13Version 2.0, 2014-11-13
9 14
10Support for VCL 4.0 15Support for VCL 4.0
11 16
12 17
13Version 1.0, 2013-10-19 18Version 1.0, 2013-10-19
diff --git a/configure.ac b/configure.ac
index 8041a57..58f7633 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,13 +11,13 @@
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details. 12# GNU General Public License for more details.
13# 13#
14# You should have received a copy of the GNU General Public License 14# You should have received a copy of the GNU General Public License
15# along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. 15# along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>.
16AC_PREREQ(2.69) 16AC_PREREQ(2.69)
17AC_INIT([vmod-tbf], 2.0, [gray@gnu.org]) 17AC_INIT([vmod-tbf], 2.0.90, [gray@gnu.org])
18AC_CONFIG_AUX_DIR([build-aux]) 18AC_CONFIG_AUX_DIR([build-aux])
19AC_CONFIG_MACRO_DIR([m4]) 19AC_CONFIG_MACRO_DIR([m4])
20AC_CONFIG_SRCDIR(src/vmod_tbf.vcc) 20AC_CONFIG_SRCDIR(src/vmod_tbf.vcc)
21AM_CONFIG_HEADER(config.h) 21AM_CONFIG_HEADER(config.h)
22 22
23AC_CANONICAL_SYSTEM 23AC_CANONICAL_SYSTEM
diff --git a/src/tbf.c b/src/tbf.c
index dadb9cc..3790a01 100644
--- a/src/tbf.c
+++ b/src/tbf.c
@@ -332,16 +332,19 @@ tbf_open_safe(const char *params)
332 tbf_open(params ? params : DEFOPENPARAMS); 332 tbf_open(params ? params : DEFOPENPARAMS);
333 pthread_mutex_unlock(&mutex); 333 pthread_mutex_unlock(&mutex);
334 return db; 334 return db;
335} 335}
336 336
337int 337int
338tbf_init(struct vmod_priv *priv, const struct VCL_conf *vclconf) 338tbf_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
339{ 339{
340 VTAILQ_INIT(&keylock_head); 340 if (e == VCL_EVENT_LOAD) {
341 VTAILQ_INIT(&keylock_avail); 341 VTAILQ_INIT(&keylock_head);
342 VTAILQ_INIT(&keylock_avail);
343 }
344 return 0;
342} 345}
343 346
344void 347void
345vmod_open(MOD_CTX ctx, const char *dir, const char *params) 348vmod_open(MOD_CTX ctx, const char *dir, const char *params)
346{ 349{
347 if (db) { 350 if (db) {
diff --git a/src/tbf.h b/src/tbf.h
index 7ee9f7e..ea0aa6e 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -19,13 +19,15 @@
19#include <stdio.h> 19#include <stdio.h>
20#include <stdbool.h> 20#include <stdbool.h>
21#include <syslog.h> 21#include <syslog.h>
22#include <inttypes.h> 22#include <inttypes.h>
23#include <sys/stat.h> 23#include <sys/stat.h>
24#include <sys/time.h> 24#include <sys/time.h>
25#include "vrt.h" 25#include <errno.h>
26#include <vcl.h>
27#include <vrt.h>
26#include "vcc_if.h" 28#include "vcc_if.h"
27#include "pthread.h" 29#include "pthread.h"
28 30
29#include "bin/varnishd/cache/cache.h" 31#include "bin/varnishd/cache/cache.h"
30#define MOD_CTX const struct vrt_ctx * 32#define MOD_CTX const struct vrt_ctx *
31#define WSPTR(s) ((s)->ws) 33#define WSPTR(s) ((s)->ws)
diff --git a/src/vmod_tbf.vcc b/src/vmod_tbf.vcc
index bb03d44..28d1af0 100644
--- a/src/vmod_tbf.vcc
+++ b/src/vmod_tbf.vcc
@@ -21,13 +21,13 @@ COLOPHON
21This document provides a short description of the **vmod-tbf** module. 21This document provides a short description of the **vmod-tbf** module.
22For a detailed documentation, please see vmod-tbf(3) manual page. 22For a detailed documentation, please see vmod-tbf(3) manual page.
23 23
24DESCRIPTION 24DESCRIPTION
25=========== 25===========
26 26
27$Init tbf_init 27$Event tbf_event
28$Function VOID open(STRING, STRING) 28$Function VOID open(STRING, STRING)
29$Function VOID close() 29$Function VOID close()
30$Function VOID sync() 30$Function VOID sync()
31$Function BOOL rate(STRING, INT, DURATION, INT) 31$Function BOOL rate(STRING, INT, DURATION, INT)
32$Function BOOL check(STRING, STRING) 32$Function BOOL check(STRING, STRING)
33$Function REAL getla(INT) 33$Function REAL getla(INT)

Return to:

Send suggestions and report system problems to the System administrator.