]> git.ipfire.org Git - thirdparty/asterisk.git/commit
tcptls.c: refactor client connection to be more robust
authorKevin Harwell <kharwell@sangoma.com>
Mon, 15 Nov 2021 22:13:19 +0000 (16:13 -0600)
committerJoshua Colp <jcolp@sangoma.com>
Wed, 5 Jan 2022 15:41:23 +0000 (09:41 -0600)
commita3fcda5a0565d902abfc7ab19249b1402a7b7c62
tree48a26d18acf7b5d12b6f773219ffc1c0dfd56b91
parent2ed004846a2a95c4b77faae4862c9cc5c2d2131c
tcptls.c: refactor client connection to be more robust

The current TCP client connect code, blocks and does not handle EINTR
error case.

This patch makes the client socket non-blocking while connecting,
ensures a connect does not immediately fail due to EINTR "errors",
and adds a connect timeout option.

The original client start call sets the new timeout option to
"infinite", thus making sure old, orginal behavior is retained.

ASTERISK-29746 #close

Change-Id: I907571843a83e43c0742b95a64785f4411f02671
include/asterisk/tcptls.h
main/tcptls.c