Update the OpenSSL Guide tutorials with changes to the demos
[openssl.git] / doc / man7 / ossl-guide-quic-client-non-block.pod
index 0c2b916b803b00b0c601353c7586ca3982024dc3..f07e9cc6692535a73ee9036f5cd7542f15fda5f6 100644 (file)
@@ -341,13 +341,26 @@ data on a retry. An optional mode does exist
 the buffer being written to change from one retry to the next. However, in this
 case, you must still retry exactly the same data - even though the buffer that
 contains that data may change location. See L<SSL_CTX_set_mode(3)> for further
-details.
+details. As in the TLS tutorials (L<ossl-guide-tls-client-block(7)>) we write
+the request in three chunks.
 
     /* Write an HTTP GET request to the peer */
-    while (!SSL_write_ex(ssl, request, strlen(request), &written)) {
+    while (!SSL_write_ex(ssl, request_start, strlen(request_start), &written)) {
         if (handle_io_failure(ssl, 0) == 1)
             continue; /* Retry */
-        printf("Failed to write HTTP request\n");
+        printf("Failed to write start of HTTP request\n");
+        goto end; /* Cannot retry: error */
+    }
+    while (!SSL_write_ex(ssl, hostname, strlen(hostname), &written)) {
+        if (handle_io_failure(ssl, 0) == 1)
+            continue; /* Retry */
+        printf("Failed to write hostname in HTTP request\n");
+        goto end; /* Cannot retry: error */
+    }
+    while (!SSL_write_ex(ssl, request_end, strlen(request_end), &written)) {
+        if (handle_io_failure(ssl, 0) == 1)
+            continue; /* Retry */
+        printf("Failed to write end of HTTP request\n");
         goto end; /* Cannot retry: error */
     }