You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hyper threads panic (though the server remains running) when a client makes multiple requests with an upgrade header (which hyper ignores). The first request is handled without issue, but when the second request is made the hyper thread panics and the connection is terminated.
Steps to reproduce:
Run the hello world example
cargo run --example hello
issue multiple requests over the same connection with an Upgrade header.
Listening on http://127.0.0.1:3000
thread 'main' panicked at 'assertion failed: self.upgrade.is_none()', src/proto/h1/conn.rs:905:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
The curl output:
* Trying 127.0.0.1:3000...
* TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:3000
> User-Agent: curl/7.66.0
> Accept: */*
> Connection: Upgrade
> Upgrade: foo
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< content-length: 12
< date: Thu, 23 Jan 2020 23:45:26 GMT
<
{ [12 bytes data]
100 12 100 12 0 0 12000 0 --:--:-- --:--:-- --:--:-- 12000
* Connection #0 to host 127.0.0.1 left intact
Hello World!* Found bundle for host 127.0.0.1: 0x5649a99f0170 [serially]
* Can not multiplex, even if we wanted to!
* Re-using existing connection! (#0) with host 127.0.0.1
* Connected to 127.0.0.1 (127.0.0.1) port 3000 (#0)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0> GET / HTTP/1.1
> Host: 127.0.0.1:3000
> User-Agent: curl/7.66.0
> Accept: */*
> Connection: Upgrade
> Upgrade: foo
>
* Connection died, retrying a fresh connect
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Closing connection 0
* Issue another request to this URL: 'http://127.0.0.1:3000/'
* Hostname 127.0.0.1 was found in DNS cache
* Trying 127.0.0.1:3000...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 3000 (#1)
> GET / HTTP/1.1
> Host: 127.0.0.1:3000
> User-Agent: curl/7.66.0
> Accept: */*
> Connection: Upgrade
> Upgrade: foo
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< content-length: 12
< date: Thu, 23 Jan 2020 23:45:26 GMT
<
{ [12 bytes data]
100 12 100 12 0 0 12000 0 --:--:-- --:--:-- --:--:-- 12000
* Connection #1 to host 127.0.0.1 left intact
Hello World!
You can see that the connection dies when the second request is issued (corresponding to the panic in the hyper output), curl then establishes a new connection and reissues the request which succeeds.
The text was updated successfully, but these errors were encountered:
yeah, thanks. I should have mentioned when opening the issue that it was only a debug_assert. In my case I'm using hyper in my httptest. The purpose of that crate is to provide a server to test against so it's typically built in debug mode. Thanks for the suggestion though.
Hyper threads panic (though the server remains running) when a client makes multiple requests with an upgrade header (which hyper ignores). The first request is handled without issue, but when the second request is made the hyper thread panics and the connection is terminated.
Steps to reproduce:
cargo run --example hello
curl -v -H "Connection: Upgrade" -H "Upgrade: foo" http://127.0.0.1:3000 http://127.0.0.1:3000
The hyper output:
The curl output:
You can see that the connection dies when the second request is issued (corresponding to the panic in the hyper output), curl then establishes a new connection and reissues the request which succeeds.
The text was updated successfully, but these errors were encountered: