Browse files

Check return value of last zsync_receive_data call after client.c:fet…

…ch_remaining_blocks_http hits eof
  • Loading branch information...
1 parent 59e7f00 commit a9a3ad50840bcff059a93383e9a70eb9eb72a2ff merlino committed with Nov 1, 2010
Showing with 6 additions and 3 deletions.
  1. +6 −3 c/client.c
View
9 c/client.c
@@ -369,9 +369,12 @@ int fetch_remaining_blocks_http(struct zsync_state *z, const char *url,
/* If error, we need to flag that to our caller */
if (len < 0)
ret = -1;
- else /* Else, let the zsync receiver know that we're at EOF; there
- *could be data in its buffer that it can use or needs to process */
- zsync_receive_data(zr, NULL, zoffset, 0);
+
+ /* Else, let the zsync receiver know that we're at EOF; there
+ * could be data in its buffer that it can use or needs to process */
+ else if( zsync_receive_data(zr, NULL, zoffset, 0) ) {
+ ret = 1;
+ }
if (!no_progress)
end_progress(&p, zsync_status(z) >= 2 ? 2 : len == 0 ? 1 : 0);

0 comments on commit a9a3ad5

Please sign in to comment.