Skip to content

Commit 57432ff

Browse files
authored
fix: Uses more specific error for TLS task cancelled issue (#3174)
1 parent 2ec1038 commit 57432ff

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

quic/s2n-quic-core/src/crypto/tls/offload.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ impl<S: tls::Session> tls::Session for OffloadSession<S> {
290290
}
291291
Err(_) => {
292292
// For whatever reason the TLS task was cancelled. We cannot continue the handshake.
293-
return Poll::Ready(Err(transport::Error::from(tls::Error::HANDSHAKE_FAILURE)));
293+
return Poll::Ready(Err(TLS_TASK_CANCELLED));
294294
}
295295
},
296296
Poll::Pending => (),
@@ -333,7 +333,7 @@ impl<S: tls::Session> tls::Session for OffloadSession<S> {
333333
}
334334
Err(_) => {
335335
// For whatever reason the TLS task was cancelled. We cannot continue the handshake.
336-
return Poll::Ready(Err(transport::Error::from(tls::Error::HANDSHAKE_FAILURE)));
336+
return Poll::Ready(Err(TLS_TASK_CANCELLED));
337337
}
338338
},
339339
Poll::Pending => (),
@@ -365,6 +365,9 @@ struct AllowedToSend {
365365
const SLICE_ERROR: crate::transport::Error =
366366
crate::transport::Error::INTERNAL_ERROR.with_reason("Slice is full");
367367

368+
const TLS_TASK_CANCELLED: crate::transport::Error =
369+
crate::transport::Error::INTERNAL_ERROR.with_reason("TLS task cancelled");
370+
368371
#[derive(Debug)]
369372
struct RemoteContext<'a, Request, H> {
370373
send_to_quic: SendSlice<'a, Request>,

0 commit comments

Comments
 (0)