Skip to content

Commit

Permalink
Merge branch 'sp/smart-http-failure'
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 Oct 12, 2011
2 parents a99c247 + 6cdf022 commit 7ed72d1
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 7ed72d1

Please sign in to comment.