add function format_http_date
parent
660a471b98
commit
d27948ed9c
3
HISTORY
3
HISTORY
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
Version 1.40 2018-09-27
|
||||
Version 1.40 2018-10-11
|
||||
* add function conn_pool_parse_server_info and conn_pool_load_server_info
|
||||
* support directive: #@add_annotation, for example:
|
||||
#@add_annotation CONFIG_GET /usr/lib/libshmcache.so /etc/libshmcache.conf
|
||||
|
|
@ -7,6 +7,7 @@ Version 1.40 2018-09-27
|
|||
* add json_parser.[hc] for parse json array and map
|
||||
* add function fc_strdup
|
||||
* add function fc_memmem
|
||||
* add function format_http_date
|
||||
|
||||
Version 1.39 2018-07-31
|
||||
* add #@function REPLACE_VARS
|
||||
|
|
|
|||
|
|
@ -2811,3 +2811,13 @@ const char *fc_memmem(const string_t *str, const string_t *needle)
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *format_http_date(time_t t, BufferInfo *buffer)
|
||||
{
|
||||
struct tm tm_info;
|
||||
|
||||
gmtime_r(&t, &tm_info);
|
||||
buffer->length = strftime(buffer->buff, buffer->alloc_size,
|
||||
"%a, %d %b %Y %H:%M:%S GMT", &tm_info);
|
||||
return buffer->buff;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -832,6 +832,14 @@ char *fc_strdup(const char *str, const int len);
|
|||
*/
|
||||
const char *fc_memmem(const string_t *str, const string_t *needle);
|
||||
|
||||
/** format HTTP Date as: Sat, 11 Mar 2017 21:49:51 GMT
|
||||
* parameters:
|
||||
* t: the time to format
|
||||
* buffer: the buffer
|
||||
* return: formatted GMT date string
|
||||
*/
|
||||
char *format_http_date(time_t t, BufferInfo *buffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue