Module: kamailio
Branch: master
Commit: 0a73437ff4126790d97679486dd852482f37be25
URL:
https://github.com/kamailio/kamailio/commit/0a73437ff4126790d97679486dd8524…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2016-11-13T12:58:46+01:00
Merge pull request #857 from armenb/memcached_delete_on_null
memcached: fix deletion bug
---
Modified: modules/memcached/mcd_var.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0a73437ff4126790d97679486dd8524…
Patch:
https://github.com/kamailio/kamailio/commit/0a73437ff4126790d97679486dd8524…
---
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;
}