Skip to content

Commit

Permalink
fix http3 compilation if http2 is disabled (seanmonstar#2304)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar authored and Nutomic committed Nov 7, 2024
1 parent f5b3469 commit 53e0ba8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/async_impl/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2418,7 +2418,7 @@ impl PendingRequest {
self.project().headers
}

#[cfg(feature = "http2")]
#[cfg(any(feature = "http2", feature = "http3"))]
fn retry_error(mut self: Pin<&mut Self>, err: &(dyn std::error::Error + 'static)) -> bool {
use log::trace;

Expand Down Expand Up @@ -2478,7 +2478,7 @@ impl PendingRequest {
}
}

#[cfg(feature = "http2")]
#[cfg(any(feature = "http2", feature = "http3"))]
fn is_retryable_error(err: &(dyn std::error::Error + 'static)) -> bool {
// pop the legacy::Error
let err = if let Some(err) = err.source() {
Expand All @@ -2496,6 +2496,7 @@ fn is_retryable_error(err: &(dyn std::error::Error + 'static)) -> bool {
}
}

#[cfg(feature = "http2")]
if let Some(cause) = err.source() {
if let Some(err) = cause.downcast_ref::<h2::Error>() {
// They sent us a graceful shutdown, try with a new connection!
Expand Down

0 comments on commit 53e0ba8

Please sign in to comment.