|
cwist
Modern C web framework with libttak runtime
|
Compression middleware and built-in zlib/brotli/zstd backends. More...
#include <cwist/sys/app/compress.h>#include <cwist/core/mem/alloc.h>#include <cwist/net/http/http.h>#include <zlib.h>#include <brotli/encode.h>#include <zstd.h>#include <string.h>#include <strings.h>#include <stdio.h>#include <stdlib.h>#include "../../net/http/async_internal.h"
Go to the source code of this file.
Macros | |
| #define | _POSIX_C_SOURCE 200809L |
| #define | CWIST_MAX_BACKENDS 8 |
Functions | |
| void | cwist_compress_register_backend (const cwist_compress_backend *backend) |
| Register a compression backend for use by the middleware. | |
| void | cwist_compress_unregister_all (void) |
| Remove all registered compression backends. | |
| const cwist_compress_backend * | cwist_compress_backend_gzip (void) |
| Get the built-in gzip backend. | |
| const cwist_compress_backend * | cwist_compress_backend_deflate (void) |
| Get the built-in deflate backend. | |
| const cwist_compress_backend * | cwist_compress_backend_brotli (void) |
| Get the built-in Brotli backend. | |
| const cwist_compress_backend * | cwist_compress_backend_zstd (void) |
| Get the built-in zstd backend. | |
| cwist_middleware_func | cwist_mw_compress (size_t min_body_size) |
| Create the response compression middleware. | |
Compression middleware and built-in zlib/brotli/zstd backends.
Definition in file compress.c.
Definition at line 6 of file compress.c.
| #define CWIST_MAX_BACKENDS 8 |
Definition at line 19 of file compress.c.
| const cwist_compress_backend * cwist_compress_backend_brotli | ( | void | ) |
Get the built-in Brotli backend.
Returns the built-in Brotli backend.
Definition at line 350 of file compress.c.
| const cwist_compress_backend * cwist_compress_backend_deflate | ( | void | ) |
Get the built-in deflate backend.
Returns the built-in zlib/deflate backend.
Definition at line 173 of file compress.c.
| const cwist_compress_backend * cwist_compress_backend_gzip | ( | void | ) |
Get the built-in gzip backend.
Returns the built-in zlib/gzip backend.
Definition at line 165 of file compress.c.
| const cwist_compress_backend * cwist_compress_backend_zstd | ( | void | ) |
Get the built-in zstd backend.
Returns the built-in Zstandard (zstd) backend.
Definition at line 524 of file compress.c.
| void cwist_compress_register_backend | ( | const cwist_compress_backend * | backend | ) |
Register a compression backend for use by the middleware.
Register a compression backend.
| backend | Backend to append to the registry. Ignored if NULL or if the registry is already full (CWIST_MAX_BACKENDS entries). |
Definition at line 30 of file compress.c.
References CWIST_MAX_BACKENDS.
Remove all registered compression backends.
Unregister all compression backends.
Definition at line 38 of file compress.c.
| cwist_middleware_func cwist_mw_compress | ( | size_t | min_body_size | ) |
Create the response compression middleware.
Response compression middleware factory.
Compression middleware factory.
| min_body_size | Minimum body size, in bytes, for compression to apply. |
Definition at line 713 of file compress.c.
References cap.