Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-07-13 14:01:11 +0400
committerCarlos Martín Nieto <carlos@cmartin.tk>2012-08-24 21:01:10 +0400
commitbffa852f89268390d6bc3e6f99f5f0cccdc88f63 (patch)
treeb83249451c776dc386856bd01e318acef801ba43 /src/fetch.c
parentc920e162325d0f9acba46a19c4619e6bfa17707e (diff)
indexer: recognize and mark when all of the packfile has been downloaded
We can't always rely on the network telling us when the download is finished. Recognize it from the indexer itself.
Diffstat (limited to 'src/fetch.c')
-rw-r--r--src/fetch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fetch.c b/src/fetch.c
index d96ac7781..eb13701f1 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -324,7 +324,10 @@ int git_fetch__download_pack(
goto on_error;
*bytes += recvd;
- } while(recvd > 0);
+ } while(recvd > 0 && !stats->data_received);
+
+ if (!stats->data_received)
+ giterr_set(GITERR_NET, "Early EOF while downloading packfile");
if (git_indexer_stream_finalize(idx, stats))
goto on_error;