Permalink
Browse files

Download progress -> callback

  • Loading branch information...
1 parent b2a60d4 commit de86dd475a685462c40182c4634f7c3c3aa61c6e @ben ben committed Jun 28, 2013
Showing with 11 additions and 1 deletion.
  1. +10 −1 src/remote.cc
  2. +1 −0 src/remote.h
View
@@ -207,10 +207,19 @@ namespace gitteh {
return Undefined();
}
+ int Remote::DownloadTransferProgressCallback(
+ const git_transfer_progress *stats,
+ void *payload)
+ {
+ DownloadBaton *baton = (DownloadBaton*)payload;
+ *baton->remote_->progress_ = *stats;
+ return 0;
+ }
+
void Remote::AsyncDownload(uv_work_t *req) {
DownloadBaton *baton = GetBaton<DownloadBaton>(req);
AsyncLibCall(git_remote_download(baton->remote_->remote_,
- baton->bytes, baton->stats), baton);
+ DownloadTransferProgressCallback, baton), baton);
}
void Remote::AsyncAfterDownload(uv_work_t *req) {
View
@@ -31,6 +31,7 @@ namespace gitteh {
static void AsyncAfterUpdateTips(uv_work_t*);
static void AsyncConnect(uv_work_t*);
static void AsyncAfterConnect(uv_work_t*);
+ static int DownloadTransferProgressCallback(const git_transfer_progress*, void*);
static void AsyncDownload(uv_work_t*);
static void AsyncAfterDownload(uv_work_t*);
};

0 comments on commit de86dd4

Please sign in to comment.