diff options
| author | Junio C Hamano <gitster@pobox.com> | 2011-11-01 15:45:16 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2011-11-01 15:45:16 -0700 |
| commit | 7fa6c90c72fb8dc8277d7cae759d5036046a5164 (patch) | |
| tree | c352c1c242ac8d3ac472e11251e7dc34365e21b3 | |
| parent | Merge jn/maint-http-error-message (diff) | |
| parent | remote-curl: Fix warning after HTTP failure (diff) | |
| download | git-7fa6c90c72fb8dc8277d7cae759d5036046a5164.tar.gz git-7fa6c90c72fb8dc8277d7cae759d5036046a5164.zip | |
Merge branch 'sp/smart-http-failure' into maint
* sp/smart-http-failure:
remote-curl: Fix warning after HTTP failure
| -rw-r--r-- | remote-curl.c | 9 |
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; |
