| 846 | } |
| 847 | |
| 848 | static int run_slot(struct active_request_slot *slot, |
| 849 | struct slot_results *results) |
| 850 | { |
| 851 | int err; |
| 852 | struct slot_results results_buf; |
| 853 | |
| 854 | if (!results) |
| 855 | results = &results_buf; |
| 856 | |
| 857 | err = run_one_slot(slot, results); |
| 858 | |
| 859 | if (err != HTTP_OK && err != HTTP_REAUTH) { |
| 860 | struct strbuf msg = STRBUF_INIT; |
| 861 | if (results->http_code && results->http_code != 200) |
| 862 | strbuf_addf(&msg, "HTTP %ld", results->http_code); |
| 863 | if (results->curl_result != CURLE_OK) { |
| 864 | if (msg.len) |
| 865 | strbuf_addch(&msg, ' '); |
| 866 | strbuf_addf(&msg, "curl %d", results->curl_result); |
| 867 | if (curl_errorstr[0]) { |
| 868 | strbuf_addch(&msg, ' '); |
| 869 | strbuf_addstr(&msg, curl_errorstr); |
| 870 | } |
| 871 | } |
| 872 | error(_("RPC failed; %s"), msg.buf); |
| 873 | strbuf_release(&msg); |
| 874 | } |
| 875 | |
| 876 | return err; |
| 877 | } |
| 878 | |
| 879 | static int probe_rpc(struct rpc_state *rpc, struct slot_results *results) |
| 880 | { |
no test coverage detected