diff options
author | Philip Withnall <pwithnall@endlessos.org> | 2020-09-24 17:49:48 +0100 |
---|---|---|
committer | Philip Withnall <pwithnall@endlessos.org> | 2020-10-22 21:03:34 +0100 |
commit | 407c683524bb362cbc39b8445015e4b06e5296a5 (patch) | |
tree | c6ac0bcc132862e8cab9277b2cb184d16c53e264 /src/libostree/ostree-fetcher.h | |
parent | 9f98aa922329757a538a4e76394779c2d5a24f23 (diff) | |
download | ostree-407c683524bb362cbc39b8445015e4b06e5296a5.tar.gz |
libostree: Add support for ETag and Last-Modified headers
Add support in the soup and curl fetchers to send the `If-None-Match`
and `If-Modified-Since` request headers, and pass on the `ETag` and
`Last-Modified` response headers.
This currently introduces no functional changes, but once call sites
provide the appropriate integration, this will allow HTTP caching to
happen with requests (typically with metadata requests, where the data
is not immutable due to being content-addressed). That should reduce
bandwidth requirements.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Diffstat (limited to 'src/libostree/ostree-fetcher.h')
-rw-r--r-- | src/libostree/ostree-fetcher.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libostree/ostree-fetcher.h b/src/libostree/ostree-fetcher.h index 32f3ea1b..2065ee54 100644 --- a/src/libostree/ostree-fetcher.h +++ b/src/libostree/ostree-fetcher.h @@ -123,6 +123,8 @@ void _ostree_fetcher_request_to_tmpfile (OstreeFetcher *self, GPtrArray *mirrorlist, const char *filename, OstreeFetcherRequestFlags flags, + const char *if_none_match, + guint64 if_modified_since, guint64 max_size, int priority, GCancellable *cancellable, @@ -132,12 +134,17 @@ void _ostree_fetcher_request_to_tmpfile (OstreeFetcher *self, gboolean _ostree_fetcher_request_to_tmpfile_finish (OstreeFetcher *self, GAsyncResult *result, GLnxTmpfile *out_tmpf, + gboolean *out_not_modified, + char **out_etag, + guint64 *out_last_modified, GError **error); void _ostree_fetcher_request_to_membuf (OstreeFetcher *self, GPtrArray *mirrorlist, const char *filename, OstreeFetcherRequestFlags flags, + const char *if_none_match, + guint64 if_modified_since, guint64 max_size, int priority, GCancellable *cancellable, @@ -147,6 +154,9 @@ void _ostree_fetcher_request_to_membuf (OstreeFetcher *self, gboolean _ostree_fetcher_request_to_membuf_finish (OstreeFetcher *self, GAsyncResult *result, GBytes **out_buf, + gboolean *out_not_modified, + char **out_etag, + guint64 *out_last_modified, GError **error); |