diff --git a/src/libostree/ostree-fetcher-curl.c b/src/libostree/ostree-fetcher-curl.c index a76a089364..eefef5e8d5 100644 --- a/src/libostree/ostree-fetcher-curl.c +++ b/src/libostree/ostree-fetcher-curl.c @@ -62,6 +62,7 @@ struct OstreeFetcher GHashTable *outstanding_requests; /* Set */ GHashTable *sockets; /* Set */ + guint64 bytes_transferred; }; /* Information associated with a request */ @@ -199,6 +200,8 @@ _ostree_fetcher_init (OstreeFetcher *self) curl_multi_setopt (self->multi, CURLMOPT_SOCKETDATA, self); curl_multi_setopt (self->multi, CURLMOPT_TIMERFUNCTION, update_timeout_cb); curl_multi_setopt (self->multi, CURLMOPT_TIMERDATA, self); + /* Let's do something reasonable here. */ + curl_multi_setopt (self->multi, CURLMOPT_MAX_TOTAL_CONNECTIONS, 8); } @@ -546,6 +549,7 @@ write_cb (void *ptr, size_t size, size_t nmemb, void *data) } req->current_size += realsize; + req->fetcher->bytes_transferred += realsize; return realsize; } @@ -879,5 +883,5 @@ _ostree_fetcher_request_to_membuf_finish (OstreeFetcher *self, guint64 _ostree_fetcher_bytes_transferred (OstreeFetcher *self) { - return 0; + return self->bytes_transferred; }