mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Don't discard data following a Websocket upgrade request
While the protocol does not allow sending data before receiving a successful Websocket upgrade response, we do not want to discard that data if it does come in.
This commit is contained in:
parent
618c001291
commit
c50d6aa09c
4 changed files with 81 additions and 60 deletions
|
@ -602,9 +602,8 @@ sys_get_state_h1(Config) ->
|
|||
{ok, Socket} = gen_tcp:connect("localhost", config(clear_port, Config), []),
|
||||
timer:sleep(100),
|
||||
Pid = get_remote_pid_tcp(Socket),
|
||||
{State, Buffer} = sys:get_state(Pid),
|
||||
State = sys:get_state(Pid),
|
||||
state = element(1, State),
|
||||
true = is_binary(Buffer),
|
||||
ok.
|
||||
|
||||
sys_get_state_h2(Config) ->
|
||||
|
@ -726,9 +725,8 @@ sys_replace_state_h1(Config) ->
|
|||
{ok, Socket} = gen_tcp:connect("localhost", config(clear_port, Config), []),
|
||||
timer:sleep(100),
|
||||
Pid = get_remote_pid_tcp(Socket),
|
||||
{State, Buffer} = sys:replace_state(Pid, fun(S) -> S end),
|
||||
State = sys:replace_state(Pid, fun(S) -> S end),
|
||||
state = element(1, State),
|
||||
true = is_binary(Buffer),
|
||||
ok.
|
||||
|
||||
sys_replace_state_h2(Config) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue