httpbf: add a 'previous_etag' entry in that is sent in If-Match header

This commit is contained in:
Olivier Goffart 2013-10-02 12:24:04 +02:00
parent fb582d8b3d
commit b29a31d36a
2 changed files with 6 additions and 0 deletions

View file

@ -124,6 +124,7 @@ Hbf_State hbf_splitlist(hbf_transfer_t *transfer, int fd ) {
transfer->fd = fd;
transfer->stat_size = sb.st_size;
transfer->modtime = sb.st_mtime;
transfer->previous_etag = NULL;
#ifndef NDEBUG
transfer->calc_size = 0;
#endif
@ -482,6 +483,10 @@ Hbf_State hbf_transfer( ne_session *session, hbf_transfer_t *transfer, const cha
ne_add_request_header(req, "X-OC-Mtime", buf);
}
if( transfer->previous_etag ) {
ne_add_request_header(req, "If-Match", transfer->previous_etag);
}
if( transfer->block_cnt > 1 ) {
ne_add_request_header(req, "OC-Chunked", "1");
}

View file

@ -98,6 +98,7 @@ struct hbf_transfer_s {
hbf_abort_callback abort_cb;
hbf_log_callback log_cb;
int modtime_accepted;
const char *previous_etag; /* etag send as the If-Match http header */
#ifndef NDEBUG
int64_t calc_size;