diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-01-20 14:40:13 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-01-20 14:40:13 +0200 |
commit | 6f72ce19982bd6f7eb9cfe7c2ebcbc221063401d (patch) | |
tree | 522208d44816d8a8bdd9298d1fe7284dbf9267c4 | |
parent | 741817ac5372c374b52b710dd8a4b0cc463ade99 (diff) | |
download | vmod-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-- | NEWS | 7 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/tbf.c | 9 | ||||
-rw-r--r-- | src/tbf.h | 4 | ||||
-rw-r--r-- | src/vmod_tbf.vcc | 2 |
5 files changed, 17 insertions, 7 deletions
@@ -1,13 +1,18 @@ | |||
1 | vmod-tbf -- history of user-visible changes. 2014-11-13 | 1 | vmod-tbf -- history of user-visible changes. 2016-01-20 |
2 | Copyright (C) 2013-2014 Sergey Poznyakoff | 2 | Copyright (C) 2013-2014 Sergey Poznyakoff |
3 | See the end of file for copying conditions. | 3 | See the end of file for copying conditions. |
4 | 4 | ||
5 | Please send vmod-tbf bug reports to <gray@gnu.org> | 5 | Please send vmod-tbf bug reports to <gray@gnu.org> |
6 | 6 | ||
7 | 7 | ||
8 | Version 2.1, (git) | ||
9 | |||
10 | Support for Varnishapi 4.1 | ||
11 | |||
12 | |||
8 | Version 2.0, 2014-11-13 | 13 | Version 2.0, 2014-11-13 |
9 | 14 | ||
10 | Support for VCL 4.0 | 15 | Support for VCL 4.0 |
11 | 16 | ||
12 | 17 | ||
13 | Version 1.0, 2013-10-19 | 18 | Version 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/>. |
16 | AC_PREREQ(2.69) | 16 | AC_PREREQ(2.69) |
17 | AC_INIT([vmod-tbf], 2.0, [gray@gnu.org]) | 17 | AC_INIT([vmod-tbf], 2.0.90, [gray@gnu.org]) |
18 | AC_CONFIG_AUX_DIR([build-aux]) | 18 | AC_CONFIG_AUX_DIR([build-aux]) |
19 | AC_CONFIG_MACRO_DIR([m4]) | 19 | AC_CONFIG_MACRO_DIR([m4]) |
20 | AC_CONFIG_SRCDIR(src/vmod_tbf.vcc) | 20 | AC_CONFIG_SRCDIR(src/vmod_tbf.vcc) |
21 | AM_CONFIG_HEADER(config.h) | 21 | AM_CONFIG_HEADER(config.h) |
22 | 22 | ||
23 | AC_CANONICAL_SYSTEM | 23 | AC_CANONICAL_SYSTEM |
@@ -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 | ||
337 | int | 337 | int |
338 | tbf_init(struct vmod_priv *priv, const struct VCL_conf *vclconf) | 338 | tbf_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 | ||
344 | void | 347 | void |
345 | vmod_open(MOD_CTX ctx, const char *dir, const char *params) | 348 | vmod_open(MOD_CTX ctx, const char *dir, const char *params) |
346 | { | 349 | { |
347 | if (db) { | 350 | if (db) { |
@@ -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 | |||
21 | This document provides a short description of the **vmod-tbf** module. | 21 | This document provides a short description of the **vmod-tbf** module. |
22 | For a detailed documentation, please see vmod-tbf(3) manual page. | 22 | For a detailed documentation, please see vmod-tbf(3) manual page. |
23 | 23 | ||
24 | DESCRIPTION | 24 | DESCRIPTION |
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) |