[pve-devel] [PATCH http-server 1/2] do not send websocket status code to port

Dominik Csapak d.csapak at proxmox.com
Thu Nov 23 15:55:55 CET 2017


this is not data, but the status code,
so print it in debug mode instead

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/APIServer/AnyEvent.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/APIServer/AnyEvent.pm b/PVE/APIServer/AnyEvent.pm
index b3b79ce..494c659 100755
--- a/PVE/APIServer/AnyEvent.pm
+++ b/PVE/APIServer/AnyEvent.pm
@@ -484,9 +484,9 @@ sub websocket_proxy {
 		if ($opcode == 1 || $opcode == 2) {
 		    $reqstate->{proxyhdl}->push_write($payload) if $reqstate->{proxyhdl};
 		} elsif ($opcode == 8) {
-		    print "websocket received close\n" if $self->{debug};
+		    my $statuscode = unpack ("n", $payload);
+		    print "websocket received close. status code: '$statuscode'\n" if $self->{debug};
 		    if ($reqstate->{proxyhdl}) {
-			$reqstate->{proxyhdl}->push_write($payload);
 			$reqstate->{proxyhdl}->push_shutdown();
 		    }
 		    $hdl->push_shutdown();
-- 
2.11.0





More information about the pve-devel mailing list