Allow all non-zero returns to cancel transfers

This commit is contained in:
Ben Straub 2013-02-05 13:14:48 -08:00
parent 42385c96d5
commit def60ea473
3 changed files with 3 additions and 3 deletions

View File

@ -536,7 +536,7 @@ int git_indexer_stream_add(git_indexer_stream *idx, const void *data, size_t siz
} }
stats->received_objects++; stats->received_objects++;
if (do_progress_callback(idx, stats) < 0) { if (do_progress_callback(idx, stats) != 0) {
error = GIT_EUSER; error = GIT_EUSER;
goto on_error; goto on_error;
} }

View File

@ -493,7 +493,7 @@ int git_smart__download_pack(
git__free(pkt); git__free(pkt);
} else if (pkt->type == GIT_PKT_DATA) { } else if (pkt->type == GIT_PKT_DATA) {
git_pkt_data *p = (git_pkt_data *) pkt; 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; goto on_error;
git__free(pkt); git__free(pkt);

View File

@ -189,7 +189,7 @@ static int cancel_at_half(const git_transfer_progress *stats, void *payload)
GIT_UNUSED(payload); GIT_UNUSED(payload);
if (stats->received_objects > (stats->total_objects/2)) if (stats->received_objects > (stats->total_objects/2))
return -1; return 1;
return 0; return 0;
} }