Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Download progress -> callback

  • Loading branch information...
commit de86dd475a685462c40182c4634f7c3c3aa61c6e 1 parent b2a60d4
@ben ben authored
Showing with 11 additions and 1 deletion.
  1. +10 −1 src/remote.cc
  2. +1 −0  src/remote.h
View
11 src/remote.cc
@@ -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
1  src/remote.h
@@ -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*);
};
Please sign in to comment.
Something went wrong with that request. Please try again.