Terminate all tcpsrv threads properly

Graceful shutdown of Rsyslog could lead to segmentation faults when
multiple imtcp inputs are being used. That is because the rest of the
tcpsrv threads are left behind running, while their underlying objects
are being disposed by the main thread as part of the module
de-initialization.

Signed-off-by: Gabor Orosz <goro@goro.io>
This commit is contained in:
Gabor Orosz 2022-01-14 19:58:17 +00:00
parent dbcef8a0d2
commit 178a36c9b4

View File

@ -1007,6 +1007,7 @@ CODESTARTrunInput
iRet = tcpsrv.Run(tcpsrv_root->tcpsrv);
/* de-init remaining servers */
etry = tcpsrv_root->next;
while(etry != NULL) {
stopSrvWrkr(etry);
etry = etry->next;