git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9f40017
)
tidying
author
Jeremy Harris
<jgh146exb@wizmail.org>
Thu, 9 Apr 2020 13:45:31 +0000
(14:45 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Thu, 9 Apr 2020 13:45:31 +0000
(14:45 +0100)
src/src/search.c
patch
|
blob
|
history
diff --git
a/src/src/search.c
b/src/src/search.c
index 2a60fc78a046c6702179df3840ed038ccdcdd3e4..d929322ba0f3808ee2852bdb062fe55093151a53 100644
(file)
--- a/
src/src/search.c
+++ b/
src/src/search.c
@@
-545,16
+545,9
@@
else
else if (do_cache)
{
else if (do_cache)
{
- int len = keylength + 1;
-
- if (t) /* Previous, out-of-date cache entry. Update with the */
- { /* new result and forget the old one */
- e->expiry = do_cache == UINT_MAX ? 0 : time(NULL)+do_cache;
- e->opts = opts;
- e->data.ptr = data;
- }
- else
+ if (!t) /* No existing entry. Create new one. */
{
{
+ int len = keylength + 1;
e = store_get(sizeof(expiring_data) + sizeof(tree_node) + len, is_tainted(keystring));
e->expiry = do_cache == UINT_MAX ? 0 : time(NULL)+do_cache;
e->opts = opts;
e = store_get(sizeof(expiring_data) + sizeof(tree_node) + len, is_tainted(keystring));
e->expiry = do_cache == UINT_MAX ? 0 : time(NULL)+do_cache;
e->opts = opts;
@@
-564,6
+557,11
@@
else
t->data.ptr = e;
tree_insertnode(&c->item_cache, t);
}
t->data.ptr = e;
tree_insertnode(&c->item_cache, t);
}
+ /* Else previous, out-of-date cache entry. Update with the */
+ /* new result and forget the old one */
+ e->expiry = do_cache == UINT_MAX ? 0 : time(NULL)+do_cache;
+ e->opts = opts;
+ e->data.ptr = data;
}
/* If caching was disabled, empty the cache tree. We just set the cache
}
/* If caching was disabled, empty the cache tree. We just set the cache