Skip to content

Commit

Permalink
Wait for ssl handshake to finish before trying to write to socket
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelortmann committed Feb 3, 2025
1 parent 541e8ac commit 7528b8e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,11 @@ void dequeue_sockets()
tv.tv_usec = 0; /* we only want to see if it's ready for writing, no need to actually wait.. */
for (i = 0; i < td->MAXSOCKS; i++)
if (!(socklist[i].flags & (SOCK_UNUSED | SOCK_TCL)) &&
(socklist[i].handler.sock.outbuf != NULL)) {
(socklist[i].handler.sock.outbuf != NULL)
#ifdef TLS
&& !(socklist[i].ssl && !SSL_is_init_finished(socklist[i].ssl))
#endif
) {
if (socklist[i].sock > maxfd)
maxfd = socklist[i].sock;
FD_SET(socklist[i].sock, &wfds);
Expand Down

0 comments on commit 7528b8e

Please sign in to comment.