|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
Format a Unix epoch as an RFC 7231 IMF-fixdate (one shared copy). More...
#include <stddef.h>#include <stdint.h>#include <time.h>Go to the source code of this file.
Functions | |
| size_t | detws_http_date (time_t epoch, char *out, size_t out_cap) |
Write epoch as an RFC 7231 IMF-fixdate into out (always GMT). | |
Format a Unix epoch as an RFC 7231 IMF-fixdate (one shared copy).
The Date: header formatter (gmtime_r + strftime to "%a, %d %b %Y %H:%M:%S GMT") was open-coded in the NTP service; the time-source-fed Date header needs the same thing. This header-only inline helper is the single home for it - reentrant (gmtime_r, never the shared static tm buffer, so it is worker-safe) and fail-closed (empty string, length 0) when the epoch is unset or does not fit a broken-down year.
Definition in file http_date.h.
|
inline |
Write epoch as an RFC 7231 IMF-fixdate into out (always GMT).
out when epoch is 0, out is null / out_cap is 0, or the time cannot be broken down. Definition at line 30 of file http_date.h.
Referenced by detws_ntp_http_date(), and detws_time_http_date().