summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-10-23 15:45:29 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-10-23 15:45:29 +0200
commit5cb136705d7db2822357582d5b726c91ca044b24 (patch)
tree8e8e7a3a55169266e7eaf6f5034c68aebe1c3951 /src
parent1c74686e05c41c30944173bacec3a8312f08cbb5 (diff)
downloadlibgit2-5cb136705d7db2822357582d5b726c91ca044b24.tar.gz
transport: let the progress output return an error
There are any number of issues that can come up in the progress callback, and we should let the user cancel at that point as well.
Diffstat (limited to 'src')
-rw-r--r--src/transports/smart_protocol.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c
index 24677908e..3b4d57856 100644
--- a/src/transports/smart_protocol.c
+++ b/src/transports/smart_protocol.c
@@ -509,7 +509,10 @@ int git_smart__download_pack(
if (pkt->type == GIT_PKT_PROGRESS) {
if (t->progress_cb) {
git_pkt_progress *p = (git_pkt_progress *) pkt;
- t->progress_cb(p->data, p->len, t->message_cb_payload);
+ if (t->progress_cb(p->data, p->len, t->message_cb_payload)) {
+ giterr_set(GITERR_NET, "The fetch was cancelled by the user");
+ return GIT_EUSER;
+ }
}
git__free(pkt);
} else if (pkt->type == GIT_PKT_DATA) {