Skip to content

Commit

Permalink
Merge branch 'sp/smart-http-failure' into maint
Browse files Browse the repository at this point in the history
* sp/smart-http-failure:
  remote-curl: Fix warning after HTTP failure
  • Loading branch information
Junio C Hamano committed Nov 1, 2011
2 parents 5b5d92a + 6cdf022 commit 7fa6c90
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion remote-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,14 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads)

close(client.in);
client.in = -1;
strbuf_read(&rpc->result, client.out, 0);
if (!err) {
strbuf_read(&rpc->result, client.out, 0);
} else {
char buf[4096];
for (;;)
if (xread(client.out, buf, sizeof(buf)) <= 0)
break;
}

close(client.out);
client.out = -1;
Expand Down

0 comments on commit 7fa6c90

Please sign in to comment.