Module: sip-router Branch: 3.2 Commit: cd1117b4c586142f4c4bf299ae324c00f3420014 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cd1117b4...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Wed Jan 16 22:37:08 2013 +0100
dialog: fix for is_in_profile()
- function was broken, reported by Klaus Darilion (cherry picked from commit 83eafc8d8f767f4705d5f76ad0ffd4349a06c927)
---
modules_k/dialog/dlg_profile.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/modules_k/dialog/dlg_profile.c b/modules_k/dialog/dlg_profile.c index 52c7205..8f3dc2c 100644 --- a/modules_k/dialog/dlg_profile.c +++ b/modules_k/dialog/dlg_profile.c @@ -567,6 +567,7 @@ int is_dlg_in_profile(struct sip_msg *msg, struct dlg_profile_table *profile, struct dlg_cell *dlg; struct dlg_profile_link *linker; struct dlg_entry *d_entry; + int ret;
/* get current dialog */ dlg = dlg_get_msg_dialog(msg); @@ -574,6 +575,7 @@ int is_dlg_in_profile(struct sip_msg *msg, struct dlg_profile_table *profile, if (dlg==NULL) return -1;
+ ret = -1; /* check the dialog linkers */ d_entry = &d_table->entries[dlg->h_entry]; dlg_lock( d_table, d_entry); @@ -581,10 +583,12 @@ int is_dlg_in_profile(struct sip_msg *msg, struct dlg_profile_table *profile, if (linker->profile==profile) { if (profile->has_value==0) { dlg_unlock( d_table, d_entry); + ret = 1; goto done; } else if (value && value->len==linker->hash_linker.value.len && memcmp(value->s,linker->hash_linker.value.s,value->len)==0){ dlg_unlock( d_table, d_entry); + ret = 1; goto done; } /* allow further search - maybe the dialog is inserted twice in @@ -596,7 +600,7 @@ int is_dlg_in_profile(struct sip_msg *msg, struct dlg_profile_table *profile,
done: dlg_release(dlg); - return -1; + return ret; }