aboutsummaryrefslogtreecommitdiff
path: root/doc
Commit message (Collapse)AuthorAgeFilesLines
* Add http_strcasecmp(3)HEADmasterXavier Del Campo Romero2026-02-272-0/+53
| | | | | | | | | POSIX.1-2008 does not any locale-specific version of strcasecmp(3), so conversions to lowercase depend on the system locale. Since HTTP header fields must be checked without case sensitivity and not depend on the system locale, a specialised function that forces the "POSIX" locale is required.
* Add http_strncasecmp(3)Xavier Del Campo Romero2026-02-272-0/+53
| | | | | | | | | POSIX.1-2008 does not any locale-specific version of strncasecmp(3), so conversions to lowercase depend on the system locale. Since HTTP header fields must be checked without case sensitivity and not depend on the system locale, a specialised function that forces the "POSIX" locale is required.
* Add HTTP op and resource to length callbackXavier Del Campo Romero2026-02-122-5/+13
| | | | | | 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.
* Add optional expiration date to http_cookie_createXavier Del Campo Romero2026-02-121-14/+14
| | | | | | | So far, libweb had been arbitrarily appending a 1-year expiration date to all HTTP cookies. While good enough for some contexts, libweb should allow users to set up their own, if any, so this arbitary decision has been eventually removed.
* Add man3 pages for the form APIv0.5.0Xavier Del Campo Romero2025-10-095-0/+207
|
* Free chunk/step user data on context freeXavier Del Campo Romero2025-10-081-1/+17
| | | | | | | | | So far, users had no way to free user-defined data allocated inside the chunk/step function pointers whenever an error occurred. Now, the free callback can be also used in conjunction with chunk/step, so that user-defined data is now deallocated when the operation finishes (in the case of chunk-encoded data) or an error occurs.
* libweb_http.7: Remove obsolete informationXavier Del Campo Romero2025-10-081-20/+5
|
* Implement HTTP chunk encodingXavier Del Campo Romero2025-10-081-10/+53
| | | | | | A new function pointer, namely chunk, has been added to struct http_response so that library users can generate their message bodies dynamically.
* Allow custom backlog connectionsXavier Del Campo Romero2025-10-061-1/+16
| | | | | | | | | libweb calls listen(2) when setting up the HTTP server, and its backlog argument was hardcoded to 10. While probably not an issue for some applications, it can be too limiting for some others. Therefore, it is desirable to allow library users to set up their own limits. Otherwise, 10 is still chosen as a sane default.
* libweb_http.7: Add note about HTTP responsesXavier Del Campo Romero2025-10-061-0/+35
|
* Fix design issues with async responses, add async exampleXavier Del Campo Romero2025-10-061-6/+44
| | | | | | | | | | | | | | | | | | 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-022-0/+124
| | | | | This new interface allows library users to parse application/x-www-form-urlencoded data conveniently.
* html: Make html_encode publicXavier Del Campo Romero2025-09-281-0/+45
| | | | | Among other reasons, this function can be useful to sanitize user-generated content before assigning it do a node.
* Implement async HTTP responsesXavier Del Campo Romero2025-09-241-0/+19
| | | | | | | | | | | | Sometimes, library users cannot return a HTTP response as soon as the request is received, or the operations that are required to generate it can take a long time. In order to solve this, libweb adds a new member to struct http_response, namely step, which must be assigned to a function whenever a HTTP response should be generated in a non-blocking manner. Leaving the function pointer as null will fall back to the default behaviour.
* Bump version to 0.4.0v0.4.0Xavier Del Campo Romero2024-08-2223-23/+23
|
* Move signal handling to processesXavier Del Campo Romero2024-08-221-0/+51
| | | | | | | | | | | | | | 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.
* Bump version to 0.3.0v0.3.0Xavier Del Campo Romero2024-02-1923-23/+23
|
* Limit maximum multipart/form-data pairs and filesXavier Del Campo Romero2024-02-192-2/+34
| | | | | | A malicious user could inject an infinite number of empty files or key/value pairs into a request in order to exhaust the device's resources.
* Bump version to 0.2.0v0.2.0Xavier Del Campo Romero2024-02-1223-23/+23
|
* libweb_http.7: Update according to status quoXavier Del Campo Romero2024-02-121-60/+137
|
* libweb_html.7: Fix typoXavier Del Campo Romero2024-02-121-1/+1
|
* Update copyright notices to 2024Xavier Del Campo Romero2024-02-1223-23/+23
|
* doc: Update handler_{loop,listen}Xavier Del Campo2023-11-206-40/+114
|
* Send HTTP headers to payload callbackXavier Del Campo Romero2023-11-182-4/+23
| | | | | | | | | | | | 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.
* doc: Add man3 page for http_decode_urldecode-urlXavier Del Campo Romero2023-11-122-0/+42
| | | | | | | Suprisingly, this man page was missing on the 0.1.0 release. The recent signature changes on http_decode_url have already been reflected.
* Adhere to GNU Make directory variablesXavier Del Campo Romero2023-10-253-32/+46
|
* Rename project from slweb to libwebv0.1.0-rc3Xavier Del Campo Romero2023-10-1122-127/+127
| | | | | | | | | | | | 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.
* Install man pagesv0.1.0-rc1Xavier Del Campo Romero2023-09-274-0/+66
|
* Add man pagesXavier Del Campo Romero2023-09-2721-0/+2246