71 * sha256 content hash |
72 * sha256 content hash |
72 */ |
73 */ |
73 char hash[32]; |
74 char hash[32]; |
74 }; |
75 }; |
75 |
76 |
|
77 /* |
|
78 * read wrapper with integrated hashing |
|
79 */ |
|
80 typedef struct { |
|
81 DAV_SHA_CTX *sha; |
|
82 void *stream; |
|
83 dav_read_func read; |
|
84 dav_seek_func seek; |
|
85 int error; |
|
86 } HashStream; |
|
87 |
|
88 struct DavInputStream { |
|
89 DavResource *res; |
|
90 CURLM *m; |
|
91 CURL *c; |
|
92 AESDecrypter *dec; |
|
93 char *buffer; |
|
94 size_t alloc; |
|
95 size_t size; |
|
96 size_t pos; |
|
97 int eof; |
|
98 }; |
|
99 |
|
100 struct DavOutputStream { |
|
101 DavResource *res; |
|
102 CURLM *m; |
|
103 CURL *c; |
|
104 AESEncrypter *enc; |
|
105 HashStream *hstr; |
|
106 const char *buffer; |
|
107 size_t size; |
|
108 size_t pos; |
|
109 int eof; |
|
110 }; |
|
111 |
76 DavResource* dav_resource_new_full(DavSession *sn, char *parent_path, char *name, char *href); |
112 DavResource* dav_resource_new_full(DavSession *sn, char *parent_path, char *name, char *href); |
77 |
113 |
78 void resource_free_properties(DavSession *sn, UcxMap *properties); |
114 void resource_free_properties(DavSession *sn, UcxMap *properties); |
79 |
115 |
80 void resource_set_href(DavResource *res, sstr_t href); |
116 void resource_set_href(DavResource *res, sstr_t href); |