summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-03-16 15:42:28 +0000
committerPauli <pauli@openssl.org>2023-03-20 09:35:55 +1100
commitd293ebde01fc14dabbd64fd6e42dc837be7b1fad (patch)
treebc7d80953de29fc9768099c76ccf678404534d33 /ssl
parent0c593328fe811583da68d25b0c8bf87ba842acbb (diff)
Fix some Windows issues in the quic_reactor
An incorrect macro name was being used for Windows detection which meant we were going down a codepath not intended for Windows and thus failing. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20514)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/quic/quic_reactor.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ssl/quic/quic_reactor.c b/ssl/quic/quic_reactor.c
index 95a54ad6b7..9581def5cf 100644
--- a/ssl/quic/quic_reactor.c
+++ b/ssl/quic/quic_reactor.c
@@ -126,13 +126,13 @@ static int poll_two_fds(int rfd, int rfd_want_read,
int wfd, int wfd_want_write,
OSSL_TIME deadline)
{
-#if defined(OSSL_SYS_WINDOWS) || !defined(POLLIN)
+#if defined(OPENSSL_SYS_WINDOWS) || !defined(POLLIN)
fd_set rfd_set, wfd_set, efd_set;
OSSL_TIME now, timeout;
struct timeval tv, *ptv;
int maxfd, pres;
-# ifndef OSSL_SYS_WINDOWS
+# ifndef OPENSSL_SYS_WINDOWS
/*
* On Windows there is no relevant limit to the magnitude of a fd value (see
* above). On *NIX the fd_set uses a bitmap and we must check the limit.
@@ -235,11 +235,12 @@ static int poll_two_fds(int rfd, int rfd_want_read,
static int poll_descriptor_to_fd(const BIO_POLL_DESCRIPTOR *d, int *fd)
{
if (d == NULL || d->type == BIO_POLL_DESCRIPTOR_TYPE_NONE) {
- *fd = -1;
+ *fd = INVALID_SOCKET;
return 1;
}
- if (d->type != BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD || d->value.fd < 0)
+ if (d->type != BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD
+ || d->value.fd == INVALID_SOCKET)
return 0;
*fd = d->value.fd;