Module: kamailio
Branch: master
Commit: c5f6cce69d7cae48f0769d89e9098a8526089055
URL:
https://github.com/kamailio/kamailio/commit/c5f6cce69d7cae48f0769d89e9098a8…
Author: Armen Babikyan <armen(a)firespotter.com>
Committer: Armen Babikyan <armen(a)firespotter.com>
Date: 2016-11-12T23:05:56-08:00
memcached: fix deletion bug
---
Modified: modules/memcached/mcd_var.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c5f6cce69d7cae48f0769d89e9098a8…
Patch:
https://github.com/kamailio/kamailio/commit/c5f6cce69d7cae48f0769d89e9098a8…
---
diff --git a/modules/memcached/mcd_var.c b/modules/memcached/mcd_var.c
index 849a668..a1b3932 100644
--- a/modules/memcached/mcd_var.c
+++ b/modules/memcached/mcd_var.c
@@ -258,13 +258,13 @@ int pv_get_mcd_value(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res) {
if (pv_mcd_key_check(msg, param, &key, &expiry) < 0)
return -1;
- if (val == NULL) {
+ if (val == NULL || val->flags&PV_VAL_NULL) {
if (memcached_delete(memcached_h, key.s, key.len, 0) != MEMCACHED_SUCCESS) {
LM_ERR("could not delete key %.*s\n", param->pvn.u.isname.name.s.len,
param->pvn.u.isname.name.s.s);
return -1;
}
- LM_WARN("delete key %.*s\n", key.len, key.s);
+ LM_DBG("delete key %.*s\n", key.len, key.s);
return 0;
}