From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A078B68E2F for ; Fri, 4 Dec 2020 18:57:20 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 936E4D38A for ; Fri, 4 Dec 2020 18:56:50 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 68EA3D29D for ; Fri, 4 Dec 2020 18:56:49 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 3580144D37 for ; Fri, 4 Dec 2020 18:56:49 +0100 (CET) From: Stoiko Ivanov To: pve-devel@lists.proxmox.com Date: Fri, 4 Dec 2020 18:56:29 +0100 Message-Id: <20201204175629.30116-6-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201204175629.30116-1-s.ivanov@proxmox.com> References: <20201204175629.30116-1-s.ivanov@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.080 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [anyevent.pm] Subject: [pve-devel] [PATCH http-server v2 5/5] debug: uniformly use dprint X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2020 17:57:20 -0000 Signed-off-by: Stoiko Ivanov --- PVE/APIServer/AnyEvent.pm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/PVE/APIServer/AnyEvent.pm b/PVE/APIServer/AnyEvent.pm index 0165264..9a4b7e7 100644 --- a/PVE/APIServer/AnyEvent.pm +++ b/PVE/APIServer/AnyEvent.pm @@ -153,7 +153,7 @@ sub client_do_disconnect { return; } - print "close connection $hdl\n" if $self->{debug}; + $self->dprint("close connection $hdl"); &$shutdown_hdl($hdl); @@ -164,7 +164,7 @@ sub client_do_disconnect { } $self->{conn_count}--; - print "$$: CLOSE FH" . $hdl->{fh}->fileno() . " CONN$self->{conn_count}\n" if $self->{debug}; + $self->dprint("CLOSE FH" . $hdl->{fh}->fileno() . " CONN$self->{conn_count}"); } sub finish_response { @@ -427,7 +427,7 @@ sub websocket_proxy { my ($fh) = @_ or die "connect to '$remhost:$remport' failed: $!"; - print "$$: CONNECTed to '$remhost:$remport'\n" if $self->{debug}; + $self->dprint("CONNECTed to '$remhost:$remport'"); $reqstate->{proxyhdl} = AnyEvent::Handle->new( fh => $fh, @@ -522,7 +522,7 @@ sub websocket_proxy { $reqstate->{proxyhdl}->push_write($payload) if $reqstate->{proxyhdl}; } elsif ($opcode == 8) { my $statuscode = unpack ("n", $payload); - print "websocket received close. status code: '$statuscode'\n" if $self->{debug}; + $self->dprint("websocket received close. status code: '$statuscode'"); if ($reqstate->{proxyhdl}) { $reqstate->{proxyhdl}->push_shutdown(); } @@ -553,7 +553,7 @@ sub websocket_proxy { "Sec-WebSocket-Protocol: $wsproto\015\012" . "\015\012"; - print $res if $self->{debug}; + $self->dprint($res); $reqstate->{hdl}->push_write($res); @@ -855,9 +855,9 @@ sub handle_spice_proxy_request { if ($node ne 'localhost' && PVE::INotify::nodename() !~ m/^$node$/i) { $remip = $self->remote_node_ip($node); - print "REMOTE CONNECT $vmid, $remip, $connect_str\n" if $self->{debug}; + $self->dprint("REMOTE CONNECT $vmid, $remip, $connect_str"); } else { - print "$$: CONNECT $vmid, $node, $spiceport\n" if $self->{debug}; + $self->dprint("CONNECT $vmid, $node, $spiceport"); } if ($remip && $r->header('PVEDisableProxy')) { @@ -875,7 +875,7 @@ sub handle_spice_proxy_request { my ($fh) = @_ or die "connect to '$remhost:$remport' failed: $!"; - print "$$: CONNECTed to '$remhost:$remport'\n" if $self->{debug}; + $self->dprint("CONNECTed to '$remhost:$remport'"); $reqstate->{proxyhdl} = AnyEvent::Handle->new( fh => $fh, rbuf_max => 64*1024, @@ -1348,7 +1348,7 @@ sub unshift_read_header { die "upload without content length header not supported" if !$len; - print "start upload $path $ct $boundary\n" if $self->{debug}; + $self->dprint("start upload $path $ct $boundary"); my $tmpfilename = get_upload_filename(); my $outfh = IO::File->new($tmpfilename, O_RDWR|O_CREAT|O_EXCL, 0600) || @@ -1599,7 +1599,7 @@ sub accept_connections { } if (!$self->{trusted_env} && !$self->check_host_access($reqstate->{peer_host})) { - print "$$: ABORT request from $reqstate->{peer_host} - access denied\n" if $self->{debug}; + $self->dprint("ABORT request from $reqstate->{peer_host} - access denied"); $reqstate->{log}->{code} = 403; $self->log_request($reqstate); shutdown($clientfh, 1); @@ -1633,7 +1633,7 @@ sub accept_connections { ($self->{tls_ctx} ? (tls => "accept", tls_ctx => $self->{tls_ctx}) : ())); $hdl_err = 0; - print "$$: ACCEPT FH" . $clientfh->fileno() . " CONN$self->{conn_count}\n" if $self->{debug}; + $self->dprint("ACCEPT FH" . $clientfh->fileno() . " CONN$self->{conn_count}"); $self->push_request_header($reqstate); } -- 2.20.1