]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
pytests/proxy: minor improvement in rehandshake processing
authorGrigorii Demidov <grigorii.demidov@nic.cz>
Wed, 16 Jan 2019 10:50:00 +0000 (11:50 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Wed, 23 Jan 2019 13:58:47 +0000 (14:58 +0100)
tests/pytests/proxy/tls-proxy.c

index b26493ceeb203fc0b4bb945c4f6530074a1e92f6..fb08beb3380fe29df0c2a76ac1c63f846621d543 100644 (file)
@@ -760,9 +760,12 @@ int tls_process_from_client(struct peer *client, const uint8_t *buf, ssize_t nre
                } else if (count == GNUTLS_E_REHANDSHAKE) {
                        tls->handshake_state = TLS_HS_IN_PROGRESS;
                        ret = tls_process_handshake(client);
-                       if (ret < 0) {
+                       if (ret < 0) { /* Critical error */
                                return ret;
                        }
+                       if (ret == 0) { /* Non fatal, most likely GNUTLS_E_AGAIN */
+                               break;
+                       }
                        continue;
                } else if (count < 0) {
                        fprintf(stdout, "[client] gnutls_record_recv failed: %s (%zd)\n",