Skip to content

Commit

Permalink
fix http3 compilation if http2 is disabled (#2304)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar authored Jun 4, 2024
1 parent a75b26a commit 57acdc1
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 @@ -2404,7 +2404,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 @@ -2464,7 +2464,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 @@ -2482,6 +2482,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 57acdc1

Please sign in to comment.