HTTP module
DateCache
Caches the formatted Date header, updated once per second.
#include <icy/http/server.h>
struct DateCacheDefined in src/http/include/icy/http/server.h:229
Caches the formatted Date header, updated once per second. Avoids per-request time formatting and string allocation.
Public Attributes
| Return | Name | Description |
|---|---|---|
char | buf | |
size_t | len | |
std::time_t | lastSecond |
buf
char buf[64]Defined in src/http/include/icy/http/server.h:231
len
size_t len = 0Defined in src/http/include/icy/http/server.h:232
lastSecond
std::time_t lastSecond = 0Defined in src/http/include/icy/http/server.h:233
Public Methods
| Return | Name | Description |
|---|---|---|
void | update inline | Refreshes the cached Date header string if the current second has changed. No-op if called multiple times within the same second. |
const char * | data const inline | Returns a pointer to the formatted "Date: ...\r\n" header string. |
size_t | size const inline | Returns the byte length of the formatted Date header string. |
update
inline
inline void update()Defined in src/http/include/icy/http/server.h:237
Refreshes the cached Date header string if the current second has changed. No-op if called multiple times within the same second.
data
const inline
inline const char * data() constDefined in src/http/include/icy/http/server.h:254
Returns a pointer to the formatted "Date: ...\r\n" header string.
size
const inline
inline size_t size() constDefined in src/http/include/icy/http/server.h:257
Returns the byte length of the formatted Date header string.
