]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
wolfssl: fix build for wolfssl without bio chain support
authorJay Satiro <raysatiro@yahoo.com>
Fri, 3 Jul 2026 14:39:08 +0000 (10:39 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 3 Jul 2026 15:42:19 +0000 (11:42 -0400)
- 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

index 3084219f876246178c70122aa8de9ee29b801c4d..e6ee960117cc415a3555d46bae601443b599ee86 100644 (file)
@@ -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 */