From b29a31d36ad110afc87964f9e76f20b4657f9cfa Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 2 Oct 2013 12:24:04 +0200 Subject: [PATCH] httpbf: add a 'previous_etag' entry in that is sent in If-Match header --- src/httpbf/src/httpbf.c | 5 +++++ src/httpbf/src/httpbf.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/httpbf/src/httpbf.c b/src/httpbf/src/httpbf.c index f55e22717..0d4a81e04 100644 --- a/src/httpbf/src/httpbf.c +++ b/src/httpbf/src/httpbf.c @@ -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"); } diff --git a/src/httpbf/src/httpbf.h b/src/httpbf/src/httpbf.h index 53066ba42..e00cc2531 100644 --- a/src/httpbf/src/httpbf.h +++ b/src/httpbf/src/httpbf.h @@ -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;