Commits

Anonymous committed 7fa6c90 Merge

Merge branch 'sp/smart-http-failure' into maint

* sp/smart-http-failure:
remote-curl: Fix warning after HTTP failure

  • Participants
  • Parent commits 5b5d92a, 6cdf022

Comments (0)

Files changed (1)

File remote-curl.c

 
 	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;