Browse code

core: added field to link sip msg in onsend structure

- to be used when opening an ongoing stream (tcp/tls) connection

Daniel-Constantin Mierla authored on 26/05/2014 12:13:30
Showing 1 changed files
... ...
@@ -43,10 +43,11 @@
43 43
 #include "sr_compat.h"
44 44
 
45 45
 struct onsend_info{
46
-	union sockaddr_union* to;
47
-	struct socket_info* send_sock;
48
-	char* buf;
49
-	int len;
46
+	union sockaddr_union* to;       /* dest info */
47
+	struct socket_info* send_sock;  /* local send socket */
48
+	char* buf;                      /* outgoing buffer */
49
+	int len;                        /* outgoing buffer len */
50
+	sip_msg_t *msg;                 /* original sip msg struct */
50 51
 };
51 52
 
52 53
 extern struct onsend_info* p_onsend;
... ...
@@ -61,7 +62,7 @@ extern struct onsend_info* p_onsend;
61 61
 static inline int run_onsend(struct sip_msg* orig_msg, struct dest_info* dst,
62 62
 								char* buf, int len)
63 63
 {
64
-	struct onsend_info onsnd_info;
64
+	struct onsend_info onsnd_info = {0};
65 65
 	int ret;
66 66
 	struct run_act_ctx ra_ctx;
67 67
 	int backup_route_type;
... ...
@@ -74,6 +75,7 @@ static inline int run_onsend(struct sip_msg* orig_msg, struct dest_info* dst,
74 74
 		onsnd_info.send_sock=dst->send_sock;
75 75
 		onsnd_info.buf=buf;
76 76
 		onsnd_info.len=len;
77
+		onsnd_info.msg=orig_msg;
77 78
 		p_onsend=&onsnd_info;
78 79
 		backup_route_type=get_route_type();
79 80
 		set_route_type(ONSEND_ROUTE);