]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
tcptls: Bad file descriptor error when reloading chan_sip
authorKevin Harwell <kharwell@digium.com>
Tue, 27 Jan 2015 22:53:57 +0000 (22:53 +0000)
committerKevin Harwell <kharwell@digium.com>
Tue, 27 Jan 2015 22:53:57 +0000 (22:53 +0000)
While running through some scenarios using chan_sip and tcp a problem would
occur that resulted in a flood of bad file descriptor messages on the cli:

tcptls.c:712 ast_tcptls_server_root: Accept failed: Bad file descriptor

The message is received because the underlying socket has been closed, so is
valid. This is probably happening because unloading of chan_sip is not atomic.
That however is outside the scope of this patch. This patch simply stops the
logging of multiple occurrences of that message.

ASTERISK-24728 #close
Reported by: Thomas Thompson
Review: https://reviewboard.asterisk.org/r/4380/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@431218 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/tcptls.c

index bc5e58d5cc6e27522577269f8362ec1e95fb8214..a480508e39d8fd6b86d7b4c0f4d48b2624b771ca 100644 (file)
@@ -707,8 +707,9 @@ void *ast_tcptls_server_root(void *data)
                }
                fd = ast_accept(desc->accept_fd, &addr);
                if (fd < 0) {
-                       if ((errno != EAGAIN) && (errno != EINTR)) {
+                       if ((errno != EAGAIN) && (errno != EWOULDBLOCK) && (errno != EINTR) && (errno != ECONNABORTED)) {
                                ast_log(LOG_WARNING, "Accept failed: %s\n", strerror(errno));
+                               break;
                        }
                        continue;
                }