Skip to content

Commit

Permalink
fixup! WIP: libcurl backend
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Jan 19, 2017
1 parent ffc0f5e commit bda80cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libostree/ostree-fetcher-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ struct OstreeFetcher
GHashTable *outstanding_requests; /* Set<GTask> */
GHashTable *sockets; /* Set<SockInfo> */

guint64 bytes_transferred;
};

/* Information associated with a request */
Expand Down Expand Up @@ -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);
}


Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

0 comments on commit bda80cd

Please sign in to comment.