Welcome! Log In Create A New Profile

Advanced

[nginx] Win32: fixed build on Windows with OpenSSL 3.0.x (ticket #2379).

Sergey Kandaurov
September 07, 2022 08:36AM
details: https://hg.nginx.org/nginx/rev/0546ab9351c8
branches:
changeset: 8068:0546ab9351c8
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed Sep 07 00:47:17 2022 +0300
description:
Win32: fixed build on Windows with OpenSSL 3.0.x (ticket #2379).

SSL_sendfile() expects integer file descriptor as an argument, but nginx
uses OS file handles (HANDLE) to work with files on Windows, and passing
HANDLE instead of an integer correctly results in build failure. Since
SSL_sendfile() is not expected to work on Windows anyway, the code is now
disabled on Windows with appropriate compile-time checks.

diffstat:

src/event/ngx_event_openssl.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r b347fe705ff2 -r 0546ab9351c8 src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c Wed Sep 07 00:47:07 2022 +0300
+++ b/src/event/ngx_event_openssl.c Wed Sep 07 00:47:17 2022 +0300
@@ -1769,7 +1769,7 @@ ngx_ssl_handshake(ngx_connection_t *c)
#endif
#endif

-#ifdef BIO_get_ktls_send
+#if (defined BIO_get_ktls_send && !NGX_WIN32)

if (BIO_get_ktls_send(SSL_get_wbio(c->ssl->connection)) == 1) {
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
@@ -1914,7 +1914,7 @@ ngx_ssl_try_early_data(ngx_connection_t
c->read->ready = 1;
c->write->ready = 1;

-#ifdef BIO_get_ktls_send
+#if (defined BIO_get_ktls_send && !NGX_WIN32)

if (BIO_get_ktls_send(SSL_get_wbio(c->ssl->connection)) == 1) {
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
@@ -2943,7 +2943,7 @@ ngx_ssl_write_early(ngx_connection_t *c,
static ssize_t
ngx_ssl_sendfile(ngx_connection_t *c, ngx_buf_t *file, size_t size)
{
-#ifdef BIO_get_ktls_send
+#if (defined BIO_get_ktls_send && !NGX_WIN32)

int sslerr, flags;
ssize_t n;
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[nginx] Win32: fixed build on Windows with OpenSSL 3.0.x (ticket #2379).

Sergey Kandaurov 285 September 07, 2022 08:36AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 213
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready