comparison src/event/ngx_event_openssl.c @ 8068:0546ab9351c8

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 07 Sep 2022 00:47:17 +0300
parents 0ce2d7a520be
children ba5cf8f73a2d
comparison
equal deleted inserted replaced
8067:b347fe705ff2 8068:0546ab9351c8
1767 1767
1768 #endif 1768 #endif
1769 #endif 1769 #endif
1770 #endif 1770 #endif
1771 1771
1772 #ifdef BIO_get_ktls_send 1772 #if (defined BIO_get_ktls_send && !NGX_WIN32)
1773 1773
1774 if (BIO_get_ktls_send(SSL_get_wbio(c->ssl->connection)) == 1) { 1774 if (BIO_get_ktls_send(SSL_get_wbio(c->ssl->connection)) == 1) {
1775 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, 1775 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
1776 "BIO_get_ktls_send(): 1"); 1776 "BIO_get_ktls_send(): 1");
1777 c->ssl->sendfile = 1; 1777 c->ssl->sendfile = 1;
1912 c->send_chain = ngx_ssl_send_chain; 1912 c->send_chain = ngx_ssl_send_chain;
1913 1913
1914 c->read->ready = 1; 1914 c->read->ready = 1;
1915 c->write->ready = 1; 1915 c->write->ready = 1;
1916 1916
1917 #ifdef BIO_get_ktls_send 1917 #if (defined BIO_get_ktls_send && !NGX_WIN32)
1918 1918
1919 if (BIO_get_ktls_send(SSL_get_wbio(c->ssl->connection)) == 1) { 1919 if (BIO_get_ktls_send(SSL_get_wbio(c->ssl->connection)) == 1) {
1920 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, 1920 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
1921 "BIO_get_ktls_send(): 1"); 1921 "BIO_get_ktls_send(): 1");
1922 c->ssl->sendfile = 1; 1922 c->ssl->sendfile = 1;
2941 2941
2942 2942
2943 static ssize_t 2943 static ssize_t
2944 ngx_ssl_sendfile(ngx_connection_t *c, ngx_buf_t *file, size_t size) 2944 ngx_ssl_sendfile(ngx_connection_t *c, ngx_buf_t *file, size_t size)
2945 { 2945 {
2946 #ifdef BIO_get_ktls_send 2946 #if (defined BIO_get_ktls_send && !NGX_WIN32)
2947 2947
2948 int sslerr, flags; 2948 int sslerr, flags;
2949 ssize_t n; 2949 ssize_t n;
2950 ngx_err_t err; 2950 ngx_err_t err;
2951 2951