aboutsummaryrefslogtreecommitdiff
path: root/examples/async/main.c
Commit message (Collapse)AuthorAgeFilesLines
* Add HTTP op and resource to length callbackXavier Del Campo Romero2026-02-121-3/+3
| | | | | | Users might want to know which HTTP operation (i.e., POST or PUT) and/or resource is being requested before determining whether the request should be accepted or not.
* Implement HTTP chunk encodingXavier Del Campo Romero2025-10-081-3/+3
| | | | | | A new function pointer, namely chunk, has been added to struct http_response so that library users can generate their message bodies dynamically.
* Fix design issues with async responses, add async exampleXavier Del Campo Romero2025-10-061-0/+232
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.