summaryrefslogtreecommitdiffabout
path: root/tests
authorSergey Poznyakoff <gray@gnu.org.ua>2017-08-03 19:21:03 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2017-08-03 19:21:03 (GMT)
commitc75a811a7734221003ac2628493832acf36b12d5 (patch) (side-by-side diff)
tree8b5a28eaf975f19badf2f9722c15ff2164bff3fb /tests
parentf9f6ba70f7844321d90476be9bc0bd5ae3e11b45 (diff)
downloadvmod-dict-c75a811a7734221003ac2628493832acf36b12d5.tar.gz
vmod-dict-c75a811a7734221003ac2628493832acf36b12d5.tar.bz2
Serialize write access. Improve API.
* src/vmod_dict.c (entry): Link into a double-linked list. (entry_append, entry_remove): New functions. (max_coll): New static. (locker_t): New type. (locker_init,locker_rlock,locker_wlock) (locker_runlock,locker_wunlock): New functions. (load_entries): Use syslog for diagnostics. Abort if unable to open the file. Fix minor memory leak. (rehash,fill_table): New functions. (dict_event): Handle VCL_EVENT_DISCARD. (vmod_load): Change signature. (vmod_ci,vmod_collisions): New functions. (vmod_clear): New function. * src/vmod_dict.vcc: Update. * tests/ci.at: Accomodate the above changes. * tests/cs.at: Likewise.
Diffstat (limited to 'tests') (more/less context) (ignore whitespace changes)
-rw-r--r--tests/ci.at4
-rw-r--r--tests/cs.at3
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/ci.at b/tests/ci.at
index 6554e53..d486188 100644
--- a/tests/ci.at
+++ b/tests/ci.at
@@ -2,7 +2,9 @@ AT_SETUP([case-insensitive])
AT_KEYWORDS([case-insensitive])
AT_VARNISHTEST([dict],[
sub vcl_init {
- dict.load("\${vmod_topsrc}/tests/num.dict", true, 0);
+ dict.ci(true);
+ dict.collisions(0);
+ dict.load("\${vmod_topsrc}/tests/num.dict");
}
sub vcl_recv {
set req.http.X-result = dict.lookup(regsub(req.url, "^/(.*)", "\1"));
diff --git a/tests/cs.at b/tests/cs.at
index f847773..0333943 100644
--- a/tests/cs.at
+++ b/tests/cs.at
@@ -2,7 +2,8 @@ AT_SETUP([case-sensitive])
AT_KEYWORDS([case-sensitive])
AT_VARNISHTEST([dict],[
sub vcl_init {
- dict.load("\${vmod_topsrc}/tests/num.dict", false, 0);
+ dict.collisions(0);
+ dict.load("\${vmod_topsrc}/tests/num.dict");
}
sub vcl_recv {
set req.http.X-result = dict.lookup(regsub(req.url, "^/(.*)", "\1"));

Return to:

Send suggestions and report system problems to the System administrator.