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(a)github.com>