Пример #1
0
FILE_CACHE *file_cache_new(const char *file_path, time_t last_modified)
{
    FILE_CACHE *cache;

    cache = (FILE_CACHE*) acl_mymalloc(sizeof(FILE_CACHE));
    cache->size = 0;
    http_mkrfc1123(cache->tm_mtime, sizeof(cache->tm_mtime), last_modified);
    ACL_SAFE_STRNCPY(cache->path, file_path, sizeof(cache->path));
    cache->fifo = acl_fifo_new();
    (void) acl_htable_enter(__cache_table, file_path, (char*) cache);
    return (cache);
}
Пример #2
0
void http_hdr_put_time(HTTP_HDR *hdr, const char *name, time_t t)
{
	char  buf[128];
	HTTP_HDR_ENTRY *entry;

	buf[sizeof(buf) - 1] = '\0';

	(void) http_mkrfc1123(buf, sizeof(buf) - 1, t);
	entry = http_hdr_entry_build(name, buf);
	if (entry)
		http_hdr_append_entry(hdr, entry);
}
Пример #3
0
void http_header::date_format(char* out, size_t size, time_t t)
{
	const char* ptr = http_mkrfc1123(out, size, t);
	if (*ptr == 0)
		logger_error("gmtime error %s", last_serror());
}