Skip to content

Commit 7fa6c90

Browse files
committed
Merge branch 'sp/smart-http-failure' into maint
* sp/smart-http-failure: remote-curl: Fix warning after HTTP failure
2 parents 5b5d92a + 6cdf022 commit 7fa6c90

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

remote-curl.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,14 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads)
573573

574574
close(client.in);
575575
client.in = -1;
576-
strbuf_read(&rpc->result, client.out, 0);
576+
if (!err) {
577+
strbuf_read(&rpc->result, client.out, 0);
578+
} else {
579+
char buf[4096];
580+
for (;;)
581+
if (xread(client.out, buf, sizeof(buf)) <= 0)
582+
break;
583+
}
577584

578585
close(client.out);
579586
client.out = -1;

0 commit comments

Comments
 (0)