Skip to content

Commit

Permalink
memcached: fix deletion bug
Browse files Browse the repository at this point in the history
(cherry picked from commit c5f6cce)
  • Loading branch information
armenfirespotter authored and miconda committed Jan 17, 2017
1 parent 97d70c1 commit b150214
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/memcached/mcd_var.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit b150214

Please sign in to comment.