aboutsummaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Add HTTP op and resource to length callbackXavier Del Campo Romero2026-02-124-12/+12
| | | | | | 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-066-0/+281
| | | | | | | | | | | | | | | | | | 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.
* Implement form interfaceXavier Del Campo Romero2025-10-025-0/+121
| | | | | This new interface allows library users to parse application/x-www-form-urlencoded data conveniently.
* examples: Add distclean targetXavier Del Campo Romero2025-10-025-0/+15
|
* examples/Makefile: Increase flexibilityXavier Del Campo Romero2025-10-021-12/+9
| | | | | The former implementation required redundant code for every new directory.
* Move signal handling to processesXavier Del Campo Romero2024-08-223-19/+213
| | | | | | | | | | | | | | So far, libweb installed a signal handler so as to handle SIGTERM, SIGPIPE and SIGINT signals so that processes would not have to care about such details. However, it is not advisable for libraries to install signal handlers, as signals are handled on a per-process basis. The previous approach would be incompatible if several instances of the library were allocated by the same process. Unfortunately, this has the undesired side effect of adding the boilerplate code into the process.
* headers/main.c: Update to new handler interfaceXavier Del Campo Romero2023-11-201-2/+11
|
* Add PUT server exampleXavier Del Campo2023-11-206-1/+141
|
* examples/hello: Update according to handler_loopXavier Del Campo2023-11-202-5/+18
|
* Send HTTP headers to payload callbackXavier Del Campo Romero2023-11-186-0/+132
| | | | | | | | | | | | Even if libweb already parses some common headers, such as Content-Length, some users might find it interesting to inspect which headers were received from a request. Since HTTP/1.1 does not define a limit on the number of maximum headers a client can send, for security reasons a maximum value must be provided by the user. Any extra headers shall be then discarded by libweb. An example application showing this new feature is also provided.
* examples: Fix wrong library nameXavier Del Campo Romero2023-10-252-2/+2
|
* Rename project from slweb to libwebv0.1.0-rc3Xavier Del Campo Romero2023-10-118-21/+21
| | | | | | | | | | | | It was found out there was another project of the same name around (https://git.sr.ht/~strahinja/slweb/), also related to website generation. In order to avoid confusion, a new name has been chosen for this project. Surprisingly, libweb was not in use by any distributions (according to https://repology.org and AUR index), and it should reflect well the intention behind this project i.e., being a library to build web-related stuff.
* examples/Makefile: Add html exampleXavier Del Campo Romero2023-09-251-1/+7
|
* Add HTML serializer exampleXavier Del Campo Romero2023-09-155-0/+115
|
* hello/main.c: Add missing length callbackXavier Del Campo Romero2023-09-071-1/+17
| | | | | Even if the feature is unsupported by the application, slweb requires `length` to be a valid function pointer.
* Add hello world exampleXavier Del Campo Romero2023-08-096-0/+161