mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-16 15:40:02 -04:00
use system resolver if no dns servers specified, make invalid frame type more verbose
This commit is contained in:
parent
f798b5544e
commit
fdd641c67f
5 changed files with 53 additions and 16 deletions
|
@ -70,7 +70,7 @@ pub enum WispError {
|
|||
StreamAlreadyClosed,
|
||||
|
||||
/// The websocket frame received had an invalid type.
|
||||
WsFrameInvalidType,
|
||||
WsFrameInvalidType(ws::OpCode),
|
||||
/// The websocket frame received was not finished.
|
||||
WsFrameNotFinished,
|
||||
/// Error specific to the websocket implementation.
|
||||
|
@ -133,7 +133,7 @@ impl std::fmt::Display for WispError {
|
|||
Self::MaxStreamCountReached => write!(f, "Maximum stream count reached"),
|
||||
Self::IncompatibleProtocolVersion => write!(f, "Incompatible Wisp protocol version"),
|
||||
Self::StreamAlreadyClosed => write!(f, "Stream already closed"),
|
||||
Self::WsFrameInvalidType => write!(f, "Invalid websocket frame type"),
|
||||
Self::WsFrameInvalidType(ty) => write!(f, "Invalid websocket frame type: {:?}", ty),
|
||||
Self::WsFrameNotFinished => write!(f, "Unfinished websocket frame"),
|
||||
Self::WsImplError(err) => write!(f, "Websocket implementation error: {}", err),
|
||||
Self::WsImplSocketClosed => {
|
||||
|
|
|
@ -487,7 +487,7 @@ impl<'a> Packet<'a> {
|
|||
return Err(WispError::WsFrameNotFinished);
|
||||
}
|
||||
if frame.opcode != OpCode::Binary {
|
||||
return Err(WispError::WsFrameInvalidType);
|
||||
return Err(WispError::WsFrameInvalidType(frame.opcode));
|
||||
}
|
||||
let mut bytes = frame.payload;
|
||||
if bytes.remaining() < 1 {
|
||||
|
@ -511,7 +511,7 @@ impl<'a> Packet<'a> {
|
|||
return Err(WispError::WsFrameNotFinished);
|
||||
}
|
||||
if frame.opcode != OpCode::Binary {
|
||||
return Err(WispError::WsFrameInvalidType);
|
||||
return Err(WispError::WsFrameInvalidType(frame.opcode));
|
||||
}
|
||||
let mut bytes = frame.payload;
|
||||
if bytes.remaining() < 5 {
|
||||
|
@ -587,7 +587,7 @@ impl<'a> TryFrom<ws::Frame<'a>> for Packet<'a> {
|
|||
return Err(Self::Error::WsFrameNotFinished);
|
||||
}
|
||||
if frame.opcode != ws::OpCode::Binary {
|
||||
return Err(Self::Error::WsFrameInvalidType);
|
||||
return Err(Self::Error::WsFrameInvalidType(frame.opcode));
|
||||
}
|
||||
Packet::try_from(frame.payload)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue