fixnuta buga v remove_last (nesnizovala grow ptr, ktery tak ubiral znaky a nemenil...
[httpfs.git] / fetch.h
blob9aa973c6fca68da1f4627cea56a7f9376eeced69
1 #include <curl/curl.h>
2 #include <pthread.h>
4 typedef enum {
5 HAND_HARD=1,
6 HAND_RANDOM=2,
7 } hand_type_t;
9 /* TODO: lockovani */
10 struct handle {
11 hand_type_t type;
12 struct grow url;
13 struct grow data;
14 struct grow lover;
16 off_t in_order, out_order;
17 off_t offset;
18 size_t total;
19 /* TODO: zjistit proc curl potrbeuje funkcni ptr na range az do konce provedeni requestu */
20 char range[32];
22 CURLM *mult;
23 CURL *conn;
24 pthread_mutex_t async_lock;
28 int request(CURL *conn, char *url, int head, struct stat *st, struct grow *data, size_t size, off_t offset);
29 int request_open_async(struct handle *h, off_t offset, size_t size);
30 void request_close_async(struct handle *h);
31 int request_perf_async(struct handle *h, size_t todo, int *done);
32 #define request_done(h) (!(h)->mult)