@@ -480,7 +480,7 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
480
480
size_t max = 1 ;
481
481
for (struct mg_connection * c = mgr -> conns ; c != NULL ; c = c -> next ) {
482
482
c -> is_readable = c -> is_writable = 0 ;
483
- if (mg_tls_pending (c ) > 0 ) ms = 1 , c -> is_readable = 1 ;
483
+ if (c -> rtls . len > 0 || mg_tls_pending (c ) > 0 ) ms = 1 , c -> is_readable = 1 ;
484
484
if (can_write (c )) MG_EPOLL_MOD (c , 1 );
485
485
if (c -> is_closing ) ms = 1 ;
486
486
max ++ ;
@@ -496,7 +496,7 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
496
496
bool wr = evs [i ].events & EPOLLOUT ;
497
497
c -> is_readable = can_read (c ) && rd ? 1U : 0 ;
498
498
c -> is_writable = can_write (c ) && wr ? 1U : 0 ;
499
- if (mg_tls_pending (c ) > 0 ) c -> is_readable = 1 ;
499
+ if (c -> rtls . len > 0 || mg_tls_pending (c ) > 0 ) c -> is_readable = 1 ;
500
500
}
501
501
}
502
502
(void ) skip_iotest ;
@@ -510,7 +510,7 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
510
510
c -> is_readable = c -> is_writable = 0 ;
511
511
if (skip_iotest (c )) {
512
512
// Socket not valid, ignore
513
- } else if (mg_tls_pending (c ) > 0 ) {
513
+ } else if (c -> rtls . len > 0 || mg_tls_pending (c ) > 0 ) {
514
514
ms = 1 ; // Don't wait if TLS is ready
515
515
} else {
516
516
fds [n ].fd = FD (c );
@@ -532,7 +532,7 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
532
532
for (struct mg_connection * c = mgr -> conns ; c != NULL ; c = c -> next ) {
533
533
if (skip_iotest (c )) {
534
534
// Socket not valid, ignore
535
- } else if (mg_tls_pending (c ) > 0 ) {
535
+ } else if (c -> rtls . len > 0 || mg_tls_pending (c ) > 0 ) {
536
536
c -> is_readable = 1 ;
537
537
} else {
538
538
if (fds [n ].revents & POLLERR ) {
@@ -541,7 +541,7 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
541
541
c -> is_readable =
542
542
(unsigned ) (fds [n ].revents & (POLLIN | POLLHUP ) ? 1 : 0 );
543
543
c -> is_writable = (unsigned ) (fds [n ].revents & POLLOUT ? 1 : 0 );
544
- if (mg_tls_pending (c ) > 0 ) c -> is_readable = 1 ;
544
+ if (c -> rtls . len > 0 || mg_tls_pending (c ) > 0 ) c -> is_readable = 1 ;
545
545
}
546
546
n ++ ;
547
547
}
@@ -563,7 +563,7 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
563
563
FD_SET (FD (c ), & eset );
564
564
if (can_read (c )) FD_SET (FD (c ), & rset );
565
565
if (can_write (c )) FD_SET (FD (c ), & wset );
566
- if (mg_tls_pending (c ) > 0 ) tvp = & tv_zero ;
566
+ if (c -> rtls . len > 0 || mg_tls_pending (c ) > 0 ) tvp = & tv_zero ;
567
567
if (FD (c ) > maxfd ) maxfd = FD (c );
568
568
if (c -> is_closing ) ms = 1 ;
569
569
}
@@ -585,7 +585,7 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
585
585
} else {
586
586
c -> is_readable = FD (c ) != MG_INVALID_SOCKET && FD_ISSET (FD (c ), & rset );
587
587
c -> is_writable = FD (c ) != MG_INVALID_SOCKET && FD_ISSET (FD (c ), & wset );
588
- if (mg_tls_pending (c ) > 0 ) c -> is_readable = 1 ;
588
+ if (c -> rtls . len > 0 || mg_tls_pending (c ) > 0 ) c -> is_readable = 1 ;
589
589
}
590
590
}
591
591
#endif
0 commit comments