aboutsummaryrefslogtreecommitdiff
path: root/examples/async/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Fix design issues with async responses, add async exampleXavier Del Campo Romero2025-10-061-0/+4
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.