remote_server: Remove dependency on libssl and libcrypto (#15446)
Fixes: #15599 Release Notes: - N/A --------- Co-authored-by: Mikayla <mikayla@zed.dev> Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
co-authored by
Mikayla
Conrad
parent
9016de5d63
commit
2c8a6ee7cc
+29
-2
@@ -117,7 +117,7 @@ impl App {
|
||||
Self(AppContext::new(
|
||||
current_platform(false),
|
||||
Arc::new(()),
|
||||
http_client::client(None, None),
|
||||
Arc::new(NullHttpClient),
|
||||
))
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ impl App {
|
||||
Self(AppContext::new(
|
||||
current_platform(true),
|
||||
Arc::new(()),
|
||||
http_client::client(None, None),
|
||||
Arc::new(NullHttpClient),
|
||||
))
|
||||
}
|
||||
|
||||
@@ -142,6 +142,14 @@ impl App {
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the http client for the application
|
||||
pub fn with_http_client(self, http_client: Arc<dyn HttpClient>) -> Self {
|
||||
let mut context_lock = self.0.borrow_mut();
|
||||
context_lock.http_client = http_client;
|
||||
drop(context_lock);
|
||||
self
|
||||
}
|
||||
|
||||
/// Start the application. The provided callback will be called once the
|
||||
/// app is fully launched.
|
||||
pub fn run<F>(self, on_finish_launching: F)
|
||||
@@ -1512,3 +1520,22 @@ pub struct KeystrokeEvent {
|
||||
/// The action that was resolved for the keystroke, if any
|
||||
pub action: Option<Box<dyn Action>>,
|
||||
}
|
||||
|
||||
struct NullHttpClient;
|
||||
|
||||
impl HttpClient for NullHttpClient {
|
||||
fn send_with_redirect_policy(
|
||||
&self,
|
||||
_req: http_client::Request<http_client::AsyncBody>,
|
||||
_follow_redirects: bool,
|
||||
) -> futures::future::BoxFuture<
|
||||
'static,
|
||||
Result<http_client::Response<http_client::AsyncBody>, anyhow::Error>,
|
||||
> {
|
||||
async move { Err(anyhow!("No HttpClient available")) }.boxed()
|
||||
}
|
||||
|
||||
fn proxy(&self) -> Option<&http_client::Uri> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user