Bugzilla Bug 331413: assert that the worker threads empty the jobQ before

they terminate.  Fix a socket leak when the SSL_ImportFD call in
handle_connection fails. r=nelson.bolyard.
This commit is contained in:
wtchang%redhat.com 2006-04-11 21:12:28 +00:00
Родитель d1a4303a76
Коммит c4307dce10
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -600,6 +600,8 @@ terminateWorkerThreads(void)
while (threadCount > 0) {
PZ_WaitCondVar(threadCountChangeCv, PR_INTERVAL_NO_TIMEOUT);
}
/* The worker threads empty the jobQ before they terminate. */
PORT_Assert(PR_CLIST_IS_EMPTY(&jobQ));
PZ_Unlock(qLock);
DESTROY_CONDVAR(jobQNotEmptyCv);
@ -824,11 +826,8 @@ handle_fdx_connection(
cleanup:
if (ssl_sock) {
PR_Close(ssl_sock);
} else
{
if (tcp_sock) {
PR_Close(tcp_sock);
}
} else if (tcp_sock) {
PR_Close(tcp_sock);
}
VLOG(("selfserv: handle_fdx_connection: exiting"));
@ -1178,6 +1177,8 @@ handle_connection(
cleanup:
if (ssl_sock) {
PR_Close(ssl_sock);
} else if (tcp_sock) {
PR_Close(tcp_sock);
}
if (local_file_fd)
PR_Close(local_file_fd);