[sr-dev] git:master:1bc3bbd0: http_async_client: do not set global avp lists from t on async callback

Daniel-Constantin Mierla miconda at gmail.com
Fri Apr 17 19:07:04 CEST 2020


Module: kamailio
Branch: master
Commit: 1bc3bbd010705ee247345c1ed9b36210bb8d9ed1
URL: https://github.com/kamailio/kamailio/commit/1bc3bbd010705ee247345c1ed9b36210bb8d9ed1

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-04-17T19:04:16+02:00

http_async_client: do not set global avp lists from t on async callback

- they are done by fake_env() used inside t_continue()
- they were set without reset, living in the process context, resulting
in invalid access when async callback was executed with faked_msg
- related to #2286

---

Modified: src/modules/http_async_client/async_http.c

---

Diff:  https://github.com/kamailio/kamailio/commit/1bc3bbd010705ee247345c1ed9b36210bb8d9ed1.diff
Patch: https://github.com/kamailio/kamailio/commit/1bc3bbd010705ee247345c1ed9b36210bb8d9ed1.patch

---

diff --git a/src/modules/http_async_client/async_http.c b/src/modules/http_async_client/async_http.c
index e468a955dc..5edf67ee5d 100644
--- a/src/modules/http_async_client/async_http.c
+++ b/src/modules/http_async_client/async_http.c
@@ -212,7 +212,7 @@ void async_http_cb(struct http_m_reply *reply, void *param)
 	}
 
 	strncpy(q_id, aq->id, strlen(aq->id));
-	
+
 	q_id[strlen(aq->id)] = '\0';
 
 	cfg_update();
@@ -227,16 +227,10 @@ void async_http_cb(struct http_m_reply *reply, void *param)
 			free_async_query(aq);
 			return;
 		}
-		// we bring the list of AVPs of the transaction to the current context
-		set_avp_list(AVP_TRACK_FROM | AVP_CLASS_URI, &t->uri_avps_from);
-		set_avp_list(AVP_TRACK_TO | AVP_CLASS_URI, &t->uri_avps_to);
-		set_avp_list(AVP_TRACK_FROM | AVP_CLASS_USER, &t->user_avps_from);
-		set_avp_list(AVP_TRACK_TO | AVP_CLASS_USER, &t->user_avps_to);
-		set_avp_list(AVP_TRACK_FROM | AVP_CLASS_DOMAIN, &t->domain_avps_from);
-		set_avp_list(AVP_TRACK_TO | AVP_CLASS_DOMAIN, &t->domain_avps_to);
-
-		if (t)
+
+		if (t) {
 			tmb.unref_cell(t);
+		}
 
 		LM_DBG("resuming transaction (%d:%d)\n", tindex, tlabel);
 




More information about the sr-dev mailing list