Module: kamailio Branch: master Commit: 22b3311f39c7b98ef0c36d2edd7d224e4269e43f URL: https://github.com/kamailio/kamailio/commit/22b3311f39c7b98ef0c36d2edd7d224e...
Author: Camille Oudot camille.oudot@orange.com Committer: Camille Oudot camille.oudot@orange.com Date: 2016-03-10T12:23:01+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
---
Modified: modules/usrloc/urecord.c
---
Diff: https://github.com/kamailio/kamailio/commit/22b3311f39c7b98ef0c36d2edd7d224e... Patch: https://github.com/kamailio/kamailio/commit/22b3311f39c7b98ef0c36d2edd7d224e...
---
diff --git a/modules/usrloc/urecord.c b/modules/usrloc/urecord.c index 7f3a1dd..a6e7cec 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);