File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ typedef enum {
5454 An optional hyper feature was not enabled.
5555 */
5656 HYPERE_FEATURE_NOT_ENABLED ,
57+ /*
58+ The peer sent an HTTP message that could not be parsed.
59+ */
60+ HYPERE_INVALID_PEER_MESSAGE ,
5761} hyper_code ;
5862
5963typedef enum {
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ pub enum hyper_code {
2020 /// An optional hyper feature was not enabled.
2121 #[ cfg_attr( feature = "http2" , allow( unused) ) ]
2222 HYPERE_FEATURE_NOT_ENABLED ,
23+ /// The peer sent an HTTP message that could not be parsed.
24+ HYPERE_INVALID_PEER_MESSAGE ,
2325}
2426
2527// ===== impl hyper_error =====
@@ -30,6 +32,7 @@ impl hyper_error {
3032 use crate :: error:: User ;
3133
3234 match self . 0 . kind ( ) {
35+ ErrorKind :: Parse ( _) => hyper_code:: HYPERE_INVALID_PEER_MESSAGE ,
3336 ErrorKind :: IncompleteMessage => hyper_code:: HYPERE_UNEXPECTED_EOF ,
3437 ErrorKind :: User ( User :: AbortedByCallback ) => hyper_code:: HYPERE_ABORTED_BY_CALLBACK ,
3538 // TODO: add more variants
You can’t perform that action at this time.
0 commit comments