From 3e4c7c993bbbe2bdeb563fa888b900d01c4be4a1 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 6 Oct 2025 01:23:20 +0200 Subject: Fix design issues with async responses, add async example struct http_response did not provide users any void * that could be used to maintain a state between calls to an asynchronous HTTP response. On the other hand, the user pointer could not be used for this purpose, since it is shared among all HTTP clients for a given struct handler instance. Moreover, the length callback was still not supporting this feature, which in fact might be required by some users. Implementing this was particularly challenging, as this broke the current assumption that all bytes on a call to http_read were being processed. Now, since a client request can only be partially processed because of the length callback, http_read must take this into account so that the remaining bytes are still available for future calls, before reading again from the file descriptor. --- examples/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/CMakeLists.txt') diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3370acb..b64430c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.13) +add_subdirectory(async) add_subdirectory(form) add_subdirectory(headers) add_subdirectory(hello) -- cgit v1.2.3