Skip to content

Commit

Permalink
[clone] Actually use that abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 22, 2020
1 parent e62adc9 commit d0bdbe4
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions git-transport/src/client/http/curl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,30 +176,7 @@ impl crate::client::http::Http for Curl {
url: &str,
headers: impl IntoIterator<Item = impl AsRef<str>>,
) -> Result<(Self::Headers, Self::ResponseBody), http::Error> {
let mut list = curl::easy::List::new();
for header in headers {
list.append(header.as_ref())?;
}
if self
.req
.send(Request {
url: url.to_owned(),
headers: list,
})
.is_err()
{
return Err(self.restore_thread_after_failure());
}
let Response {
headers,
body,
upload_body: _,
} = match self.res.recv() {
Ok(res) => res,
Err(_) => return Err(self.restore_thread_after_failure()),
};

Ok((headers, body))
self.make_request(url, headers, None::<std::fs::File>)
}

fn post(
Expand Down

0 comments on commit d0bdbe4

Please sign in to comment.