summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-12 12:34:27 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-12 12:34:27 -0700
commit7ed72d1813e570f21259f3576fde0cc62b6de888 (patch)
treeb62664bf5b94af831608842252964090411cfb55 /remote-curl.c
parenta99c247c5380b83477e7f6ab4ba7b5488a49f28a (diff)
parent6cdf0223fe4a9ccae543fece8b5e78a626ccdf89 (diff)
downloadgit-7ed72d1813e570f21259f3576fde0cc62b6de888.tar.gz
Merge branch 'sp/smart-http-failure'
* sp/smart-http-failure: remote-curl: Fix warning after HTTP failure
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index b8cf45a7dd..0aa4bfed30 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -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;