[sr-dev] [kamailio/kamailio] tcpclose event_routes issue (PR #2980)

Daniel-Constantin Mierla notifications at github.com
Wed Dec 22 09:02:37 CET 2021


Thanks for the PR!

I would suggest to add a new field to `tcp_connection` structure, like `event`, which is set to the event type of closing the tcp connection, so what was removed by current PR:

```
-				if (errno == ETIMEDOUT) {
-					tcp_emit_closed_event(c, TCP_CLOSED_TIMEOUT);
-				} else if (errno == ECONNRESET) {
-					tcp_emit_closed_event(c, TCP_CLOSED_RESET);
-				}
```

 becomes like:

```
				if (errno == ETIMEDOUT) {
					c->event = TCP_CLOSED_TIMEOUT;
				} else if (errno == ECONNRESET) {
					c->event = TCP_CLOSED_RESET;
				}
```

Same in other similar cases.

Then, when calling the emit function, if the `event` field is set, then it is used.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2980#issuecomment-999364416
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/2980/c999364416 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20211222/0d7cc440/attachment.htm>


More information about the sr-dev mailing list