-
Notifications
You must be signed in to change notification settings - Fork 2
/
http_cache.h
41 lines (30 loc) · 907 Bytes
/
http_cache.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Copyright (C) 2021 Edward LEI <edward_lei72@hotmail.com>
*
* license: MIT license
*/
#ifndef _HTTP_CACHE_H_
#define _HTTP_CACHE_H_
typedef struct _cache_data cache_data_t;
struct _cache_data {
char *path;
char *etag;
char *last_modified;
unsigned char *body;
unsigned char *body_zipped;
size_t len_body;
size_t len_zipped;
};
cache_data_t *http_cache_data_new();
void http_set_cache_data(cache_data_t *data,
char *path,
char *etag,
char *modified,
unsigned char *body,
const size_t len_body,
unsigned char *body_zipped,
const size_t len_zipped);
void http_cache_data_destroy(cache_data_t *data);
cache_data_t *http_cache_data(list_t *cache,
const char *path);
#endif