Browse code

core: tcp - execute receive msg after nonsip-hook for hep3 packets

Daniel-Constantin Mierla authored on 06/11/2017 11:54:18
Showing 1 changed files
... ...
@@ -70,6 +70,7 @@
70 70
 #include "forward.h"
71 71
 #include "events.h"
72 72
 #include "stun.h"
73
+#include "nonsip_hooks.h"
73 74
 
74 75
 #ifdef READ_HTTP11
75 76
 #define HTTP11CONTINUE	"HTTP/1.1 100 Continue\r\nContent-Length: 0\r\n\r\n"
... ...
@@ -1325,9 +1326,21 @@ static int hep3_process_msg(char* tcpbuf, unsigned int len,
1325 1326
 	evp.data = (void*)(&msg);
1326 1327
 	ret=sr_event_exec(SREV_RCV_NOSIP, &evp);
1327 1328
 	LM_DBG("running hep3 handling event returned %d\n", ret);
1329
+	if(ret == NONSIP_MSG_DROP) {
1330
+		free_sip_msg(&msg);
1331
+		return 0;
1332
+	}
1333
+	if(ret < 0) {
1334
+		LM_ERR("error running hep3 handling event: %d\n", ret);
1335
+		free_sip_msg(&msg);
1336
+		return -1;
1337
+	}
1338
+
1339
+	ret = receive_msg(msg.buf, msg.len, rcv_info);
1340
+	LM_DBG("running hep3-enclosed sip request route returned %d\n", ret);
1328 1341
 	free_sip_msg(&msg);
1329 1342
 
1330
-	return 0;
1343
+	return ret;
1331 1344
 }
1332 1345
 
1333 1346
 /**