Commit def60ea4 by Ben Straub

Allow all non-zero returns to cancel transfers

parent 42385c96
......@@ -536,7 +536,7 @@ int git_indexer_stream_add(git_indexer_stream *idx, const void *data, size_t siz
}
stats->received_objects++;
if (do_progress_callback(idx, stats) < 0) {
if (do_progress_callback(idx, stats) != 0) {
error = GIT_EUSER;
goto on_error;
}
......
......@@ -493,7 +493,7 @@ int git_smart__download_pack(
git__free(pkt);
} else if (pkt->type == GIT_PKT_DATA) {
git_pkt_data *p = (git_pkt_data *) pkt;
if ((error = writepack->add(writepack, p->data, p->len, stats)) < 0)
if ((error = writepack->add(writepack, p->data, p->len, stats)) != 0)
goto on_error;
git__free(pkt);
......
......@@ -189,7 +189,7 @@ static int cancel_at_half(const git_transfer_progress *stats, void *payload)
GIT_UNUSED(payload);
if (stats->received_objects > (stats->total_objects/2))
return -1;
return 1;
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment