summaryrefslogtreecommitdiff
path: root/src/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/url.c')
-rw-r--r--src/url.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/url.c b/src/url.c
index 711755a..4d7c7e6 100644
--- a/src/url.c
+++ b/src/url.c
@@ -102,6 +102,12 @@ static void fetch_close(void *stream)
free(fis);
}
+static const struct apk_istream_ops fetch_istream_ops = {
+ .get_meta = fetch_get_meta,
+ .read = fetch_read,
+ .close = fetch_close,
+};
+
static struct apk_istream *apk_istream_fetch(const char *url, time_t since)
{
struct apk_fetch_istream *fis;
@@ -121,9 +127,7 @@ static struct apk_istream *apk_istream_fetch(const char *url, time_t since)
}
*fis = (struct apk_fetch_istream) {
- .is.get_meta = fetch_get_meta,
- .is.read = fetch_read,
- .is.close = fetch_close,
+ .is.ops = &fetch_istream_ops,
.fetchIO = io,
.urlstat = fis->urlstat,
};