HTTP module
DateCache
Caches the formatted Date header, updated once per second.
DateCache
#include <icy/http/server.h>struct DateCacheDefined in src/http/include/icy/http/server.h:228
Caches the formatted Date header, updated once per second. Avoids per-request time formatting and string allocation.
List of all members
| Name | Kind | Owner |
|---|---|---|
buf | variable | Declared here |
len | variable | Declared here |
lastSecond | variable | Declared here |
update | function | Declared here |
data | function | Declared here |
size | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
char | buf | |
size_t | len | |
std::time_t | lastSecond |
buf
char buf {}Defined in src/http/include/icy/http/server.h:230
len
size_t len = 0Defined in src/http/include/icy/http/server.h:231
lastSecond
std::time_t lastSecond = 0Defined in src/http/include/icy/http/server.h:232
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:236
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:253
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:256
Returns the byte length of the formatted Date header string.
