Module: kamailio
Branch: 4.3
Commit: 1c7154d832eeb51db790b84a850c5f6338619ce6
URL:
https://github.com/kamailio/kamailio/commit/1c7154d832eeb51db790b84a850c5f6…
Author: Camille Oudot <camille.oudot(a)orange.com>
Committer: Camille Oudot <camille.oudot(a)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/1c7154d832eeb51db790b84a850c5f6…
Patch:
https://github.com/kamailio/kamailio/commit/1c7154d832eeb51db790b84a850c5f6…
---
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);