mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 11:52:12 +00:00
Allow all non-zero returns to cancel transfers
This commit is contained in:
parent
42385c96d5
commit
def60ea473
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user