fix(http2): send a GOAWAY when the user's Service::poll_ready errors
The `Error::source()` is searched for an `h2::Error` to allow sending different error codes in the GOAWAY. If none is found, it defaults to `INTERNAL_ERROR`.
This commit is contained in:
@@ -555,7 +555,6 @@ where
|
||||
match polled {
|
||||
Ok(x) => return Ok(x),
|
||||
Err(e) => {
|
||||
debug!("error polling connection protocol without shutdown: {}", e);
|
||||
match *e.kind() {
|
||||
Kind::Parse(Parse::VersionH2) if self.fallback.to_h2() => {
|
||||
self.upgrade_h2();
|
||||
@@ -644,7 +643,6 @@ where
|
||||
}
|
||||
})),
|
||||
Err(e) => {
|
||||
debug!("error polling connection protocol: {}", e);
|
||||
match *e.kind() {
|
||||
Kind::Parse(Parse::VersionH2) if self.fallback.to_h2() => {
|
||||
self.upgrade_h2();
|
||||
@@ -962,7 +960,6 @@ mod upgrades {
|
||||
return Ok(Async::Ready(()));
|
||||
},
|
||||
Err(e) => {
|
||||
debug!("error polling connection protocol: {}", e);
|
||||
match *e.kind() {
|
||||
Kind::Parse(Parse::VersionH2) if self.inner.fallback.to_h2() => {
|
||||
self.inner.upgrade_h2();
|
||||
|
||||
Reference in New Issue
Block a user