瀏覽代碼

dialog(k): proper local linking of profile before dlg is created

- reported by Nick R.
Daniel-Constantin Mierla 13 年之前
父節點
當前提交
80c4f4b1d9
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      modules_k/dialog/dlg_profile.c

+ 7 - 0
modules_k/dialog/dlg_profile.c

@@ -468,6 +468,13 @@ int set_dlg_profile(struct sip_msg *msg, str *value, struct dlg_profile_table *p
 		/* add linker directly to the dialog and profile */
 		/* add linker directly to the dialog and profile */
 		link_dlg_profile( linker, dlg);
 		link_dlg_profile( linker, dlg);
 	} else {
 	} else {
+		/* if existing linkers are not from current request, just discard them */
+		if (msg->id!=current_dlg_msg_id || msg->pid!=current_dlg_msg_pid) {
+			current_dlg_msg_id = msg->id;
+			current_dlg_msg_pid = msg->pid;
+			destroy_linkers(current_pending_linkers);
+			current_pending_linkers = NULL;
+		}
 		/* no dialog yet -> set linker as pending */
 		/* no dialog yet -> set linker as pending */
 		if (msg->id!=current_dlg_msg_id || msg->pid!=current_dlg_msg_pid) {
 		if (msg->id!=current_dlg_msg_id || msg->pid!=current_dlg_msg_pid) {
 			current_dlg_msg_id = msg->id;
 			current_dlg_msg_id = msg->id;