-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp_cache.h
More file actions
44 lines (30 loc) · 909 Bytes
/
http_cache.h
File metadata and controls
44 lines (30 loc) · 909 Bytes
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
42
43
44
/* license: MIT license
* Copyright (C) 2021 Edward LEI <edward_lei72@hotmail.com> */
#ifndef _HTTP_CACHE_H_
#define _HTTP_CACHE_H_
typedef struct {
char *path;
char *etag;
char *last_modified;
long stamp;
unsigned char *body;
unsigned char *body_zipped;
size_t len_body;
size_t len_zipped;
} httpcache_t;
httpcache_t *httpcache_new();
void httpcache_set(httpcache_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 httpcache_clear(void *data);
void httpcache_delete(void *data);
int httpcache_compare(const void *curr,
const void *cache);
void httpcache_expire(void *arg);
void httpcache_print(const void *data);
#endif