Lines Matching +full:wait +full:- +full:retry +full:- +full:us

2  *  Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
11 * @file quic-hq-interop.c
15 * interoperability with hq-interop servers. It handles connection setup,
20 * and uses non-blocking mode for QUIC operations.
30 * quic-hq-interop <host> <port> <reqfile>
31 * host - The hostname of the server to contact
32 * port - The port that the server is listening on
33 * reqfile - a text file containing a space separated list of paths to fetch
37 * SSLKEYLOGFILE - set to a file path to record keylog exchange with server
38 * SSL_SESSION_FILE - set to a file path to record ssl sessions and restore
40 * SSL_CERT_FILE - The ca file to use when validating a server
41 * SSL_CIPHER_SUITES - The list of cipher suites to use (see openssl-ciphers)
93 * @note The function uses OpenSSL's socket-related functions (e.g., BIO_socket,
103 int sock = -1; in create_socket_bio()
121 * Create a UDP socket. We could equally use non-OpenSSL calls such in create_socket_bio()
128 if (sock == -1) in create_socket_bio()
134 sock = -1; in create_socket_bio()
145 sock = -1; in create_socket_bio()
152 if (sock != -1) { in create_socket_bio()
163 /* If sock is -1 then we've been unable to connect to the server */ in create_socket_bio()
164 if (sock == -1) in create_socket_bio()
195 * It uses the select function to wait until the socket is either readable
240 * Wait until the socket is writeable or readable. We use select here in wait_for_activity()
273 * - 1: Temporary failure, the operation should be retried.
274 * - 0: EOF, indicating the connection has been closed.
275 * - -1: A fatal error occurred or the connection has been reset.
288 /* Temporary failure. Wait until we can read/write and try again */ in handle_io_failure()
297 return -1; in handle_io_failure()
302 * stream reset - or some failure occurred on the underlying in handle_io_failure()
330 return -1; in handle_io_failure()
333 return -1; in handle_io_failure()
558 * note req_idx may start at a non-zero value if in build_request_set()
565 poll_idx = poll_count - 1; in build_request_set()
613 * opportunity to send us updated MAX_STREAM frames to extend our stream in build_request_set()
625 * the server has a MAX_STREAM frame for us to process in build_request_set()
640 poll_count--; in build_request_set()
656 continue; /* Retry */ in build_request_set()
658 goto err; /* Cannot retry: error */ in build_request_set()
691 * performs host verification, configures ALPN, and establishes a non-blocking
704 unsigned char alpn[] = {10, 'h', 'q', '-', 'i', 'n', 't', 'e', 'r', 'o', 'p'}; in setup_connection()
818 continue; /* Retry */ in setup_connection()
820 goto end; /* Cannot retry: error */ in setup_connection()
835 * @brief Entry point for the QUIC hq-interop client demo application.
838 * requests for files specified in the command-line arguments, and saves
842 * @param argc The number of command-line arguments.
843 * @param argv The array of command-line arguments. The expected format is
848 * - Parses command-line arguments.
849 * - Reads the list of requests from the specified file.
850 * - Sets up the SSL context and configures certificate verification.
851 * - Optionally enables key logging and session caching.
852 * - Establishes a non-blocking QUIC connection to the server.
853 * - Sends an HTTP GET request for each file and writes the response
855 * - Gracefully shuts down the SSL connection and frees resources.
856 * - Prints any OpenSSL error stack information on failure.
882 fprintf(stderr, "Usage: quic-hq-interop hostname port reqfile\n"); in main()
923 req_array[total_requests - 1] = req; in main()
956 result_count--; in main()
974 break; /* Retry on next poll */ in main()
978 case -1: in main()
981 goto end; /* Cannot retry: error */ in main()
1017 continue; /* Retry */ in main()