mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 21:35:47 +03:00
httpbf: add a 'previous_etag' entry in that is sent in If-Match header
This commit is contained in:
parent
fb582d8b3d
commit
b29a31d36a
2 changed files with 6 additions and 0 deletions
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue