[sr-dev] git:4.3:1c7154d8: usrloc: improve TCP close on expire

Camille Oudot camille.oudot at orange.com
Thu Mar 10 12:25:25 CET 2016


Module: kamailio
Branch: 4.3
Commit: 1c7154d832eeb51db790b84a850c5f6338619ce6
URL: https://github.com/kamailio/kamailio/commit/1c7154d832eeb51db790b84a850c5f6338619ce6

Author: Camille Oudot <camille.oudot at orange.com>
Committer: Camille Oudot <camille.oudot at orange.com>
Date: 2016-03-10T12:25:07+01:00

usrloc: improve TCP close on expire

this prevents the dramatic `F_TCPCONN connection marked as bad` message from
appearing in the logs when usrloc force-closes a TCP connection

(cherry picked from commit 22b3311f39c7b98ef0c36d2edd7d224e4269e43f)

---

Modified: modules/usrloc/urecord.c

---

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

---

diff --git a/modules/usrloc/urecord.c b/modules/usrloc/urecord.c
index 414a958..4b685dc 100644
--- a/modules/usrloc/urecord.c
+++ b/modules/usrloc/urecord.c
@@ -251,6 +251,9 @@ static inline int close_connection(int conid) {
 		msg[0] = (long)con;
 		msg[1] = CONN_EOF;
 
+		con->send_flags.f |= SND_F_CON_CLOSE;
+		con->flags |= F_CONN_FORCE_EOF;
+
 		n = send_all(unix_tcp_sock, msg, sizeof(msg));
 		if (unlikely(n <= 0)){
 			LM_ERR("failed to send close request: %s (%d)\n", strerror(errno), errno);




More information about the sr-dev mailing list