]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
gnutls: fix connection state check on handshake
authorStefan Eissing <stefan@eissing.org>
Fri, 21 Feb 2025 13:42:26 +0000 (14:42 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 22 Feb 2025 00:01:10 +0000 (01:01 +0100)
When running curl event based, connect attempts stalled as the 'done'
check was using the wrong state in gnutls.

Add event based pytest runs to all http3 jobs and the openssl and
mbedtls ones on linux.

Closes #16423

.github/workflows/http3-linux.yml
lib/vtls/gtls.c

index cac14f05a866f4d176e39dd1f7587ee126a72aa0..00ddca4fb54c877a6406cad5ec58951b50c429a9 100644 (file)
@@ -232,6 +232,7 @@ jobs:
               --with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug --disable-ntlm
               --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
               --with-openssl=$HOME/quictls/build --enable-ssls-export
+              --with-libuv
 
           - name: gnutls
             PKG_CONFIG_PATH: '$HOME/gnutls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
@@ -240,6 +241,7 @@ jobs:
               --with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug
               --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
               --with-gnutls=$HOME/gnutls/build --enable-ssls-export
+              --with-libuv
 
           - name: wolfssl
             PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
@@ -249,6 +251,7 @@ jobs:
               --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
               --with-wolfssl=$HOME/wolfssl/build
               --enable-ech --enable-ssls-export
+              --with-libuv
 
           - name: wolfssl
             PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
@@ -257,6 +260,7 @@ jobs:
               -DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
               -DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
               -DUSE_ECH=ON
+              -DCURL_USE_LIBUV=ON
 
           - name: openssl-quic
             PKG_CONFIG_PATH: '$HOME/openssl/build/lib64/pkgconfig'
@@ -266,6 +270,7 @@ jobs:
               --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
               --with-openssl=$HOME/openssl/build --with-openssl-quic
               --with-nghttp3=$HOME/nghttp3/build
+              --with-libuv
 
           - name: quiche
             configure: >-
@@ -275,6 +280,7 @@ jobs:
               --with-quiche=$HOME/quiche/target/release
               --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
               --with-ca-fallback
+              --with-libuv
 
           - name: quiche
             PKG_CONFIG_PATH: '$HOME/quiche/target/release'
@@ -284,6 +290,7 @@ jobs:
               -DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
               -DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
               -DCURL_CA_FALLBACK=ON
+              -DCURL_USE_LIBUV=ON
 
     steps:
       - name: 'install prereqs'
@@ -295,7 +302,7 @@ jobs:
             libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \
             nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \
             libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \
-            texinfo texlive texlive-extra-utils autopoint libev-dev \
+            texinfo texlive texlive-extra-utils autopoint libev-dev libuv1-dev \
             apache2 apache2-dev libnghttp2-dev vsftpd
           python3 -m venv $HOME/venv
           echo 'CC=gcc-12' >> $GITHUB_ENV
@@ -490,9 +497,10 @@ jobs:
           source $HOME/venv/bin/activate
           python3 -m pip install -r tests/http/requirements.txt
 
-      - name: 'run pytest'
+      - name: 'run pytest event based'
         env:
           TFLAGS: '${{ matrix.build.tflags }}'
+          CURL_TEST_EVENT: 1
           CURL_CI: github
           PYTEST_ADDOPTS: '--color=yes'
         run: |
index 84cb38739886aa99569b8ec42cde874d6485929d..9bd75181ea2d774b2a1d4d383377e0e5630ade4a 100644 (file)
@@ -1951,8 +1951,9 @@ out:
     *done = FALSE;
     return CURLE_OK;
   }
-  *done = ((connssl->connecting_state == ssl_connect_1) ||
+  *done = ((connssl->state == ssl_connection_complete) ||
            (connssl->state == ssl_connection_deferred));
+  CURL_TRC_CF(data, cf, "gtls_connect_common() -> %d, done=%d", result, *done);
   return result;
 }