Module: kamailio Branch: 5.8 Commit: d647cac53a603b1c1a44f39eb0c279904a63165d URL: https://github.com/kamailio/kamailio/commit/d647cac53a603b1c1a44f39eb0c279904a63165d
Author: Daniel-Constantin Mierla <[email protected]> Committer: Daniel-Constantin Mierla <[email protected]> Date: 2025-12-01T13:48:36+01:00 core: tcp - decrease busy field if sending to child fails - GH #4437 (cherry picked from commit 52f9a57e1a4a817b7ad0c05b3673daaf8458bc92) (cherry picked from commit 53091debc027d71a38ccad9adfc9fe35ac22da62) --- Modified: src/core/tcp_main.c --- Diff: https://github.com/kamailio/kamailio/commit/d647cac53a603b1c1a44f39eb0c279904a63165d.diff Patch: https://github.com/kamailio/kamailio/commit/d647cac53a603b1c1a44f39eb0c279904a63165d.patch --- diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c index f91962ab399..40591bfc3c0 100644 --- a/src/core/tcp_main.c +++ b/src/core/tcp_main.c @@ -4402,8 +4402,11 @@ inline static int send2child(struct tcp_connection *tcpconn) even replaced by another one with the same number) so it must not be sent to a reader anymore */ if(unlikely(tcpconn->state == S_CONN_BAD - || (tcpconn->flags & F_CONN_FD_CLOSED))) + || (tcpconn->flags & F_CONN_FD_CLOSED))) { + tcp_children[idx].busy--; + tcp_children[idx].n_reqs--; return -1; + } #ifdef SEND_FD_QUEUE /* if queue full, try to queue the io */ if(unlikely(send_fd(tcp_children[idx].unix_sock, &tcpconn, sizeof(tcpconn), @@ -4418,11 +4421,15 @@ inline static int send2child(struct tcp_connection *tcpconn) &send2child_q, tcp_children[idx].unix_sock, tcpconn) != 0) { LM_ERR("queue send op. failed\n"); + tcp_children[idx].busy--; + tcp_children[idx].n_reqs--; return -1; } } else { LM_ERR("send_fd failed for %p (flags 0x%0x), fd %d\n", tcpconn, tcpconn->flags, tcpconn->s); + tcp_children[idx].busy--; + tcp_children[idx].n_reqs--; return -1; } } @@ -4432,6 +4439,8 @@ inline static int send2child(struct tcp_connection *tcpconn) <= 0)) { LM_ERR("send_fd failed for %p (flags 0x%0x), fd %d\n", tcpconn, tcpconn->flags, tcpconn->s); + tcp_children[idx].busy--; + tcp_children[idx].n_reqs--; return -1; } #endif _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
