Refactoring for an improved event loop

This commit is contained in:
2025-07-21 20:29:35 +02:00
parent 5cb3977c3c
commit a2912b5191
17 changed files with 3001 additions and 2381 deletions
+2 -8
View File
@@ -13,17 +13,11 @@ int main(void)
HTTP_STR("User-Agent: cHTTP"),
};
// Request handle that will be necessary to
// free the request's resources when we are
// done with the result.
HTTP_RequestHandle handle;
// Perform the request. This will block the thread
// until an error occurs or the request completes.
HTTP_Response *res = http_get(
HTTP_STR("http://example.com/index.html"),
headers, HTTP_COUNT(headers),
&handle
headers, HTTP_COUNT(headers)
);
// The http_get function returns NULL if the request
@@ -51,7 +45,7 @@ int main(void)
// When we are done reading from the response object
// we must free the request's resources.
http_request_free(handle);
http_request_free(res);
// All done. Deinitialize the library.
http_global_free();