From 3dd6a87a7feaecbb66555b11a390b31bb4513b9f Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Fri, 3 Jul 2026 10:39:08 -0400 Subject: [PATCH] wolfssl: fix build for wolfssl without bio chain support - Do not mix declarations and code. (ISO C90 build error) Ref: https://github.com/curl/curl/pull/22252#issuecomment-4871171567 Closes https://github.com/curl/curl/pull/22255 --- lib/vtls/wolfssl.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 3084219f87..e6ee960117 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1539,15 +1539,17 @@ static CURLcode wssl_connect_step1(struct Curl_cfilter *cf, wolfSSL_set_bio(wssl->ssl, bio, bio); } #else /* !USE_BIO_CHAIN */ - curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data); - if(sockfd > INT_MAX) { - failf(data, "SSL: socket value too large"); - return CURLE_SSL_CONNECT_ERROR; - } - /* pass the raw socket into the SSL layer */ - if(!wolfSSL_set_fd(wssl->ssl, (int)sockfd)) { - failf(data, "SSL: wolfSSL_set_fd failed"); - return CURLE_SSL_CONNECT_ERROR; + { + curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data); + if(sockfd > INT_MAX) { + failf(data, "SSL: socket value too large"); + return CURLE_SSL_CONNECT_ERROR; + } + /* pass the raw socket into the SSL layer */ + if(!wolfSSL_set_fd(wssl->ssl, (int)sockfd)) { + failf(data, "SSL: wolfSSL_set_fd failed"); + return CURLE_SSL_CONNECT_ERROR; + } } #endif /* USE_BIO_CHAIN */