mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-27 09:59:33 +00:00
add tls_ctx to proxy requests
and fix a typo
This commit is contained in:
parent
f91072d56f
commit
353fef2430
@ -282,8 +282,9 @@ sub proxy_request {
|
|||||||
$method => $target,
|
$method => $target,
|
||||||
headers => $headers,
|
headers => $headers,
|
||||||
timeout => 30,
|
timeout => 30,
|
||||||
resurse => 0,
|
recurse => 0,
|
||||||
body => $content,
|
body => $content,
|
||||||
|
tls_ctx => $self->{tls_ctx},
|
||||||
sub {
|
sub {
|
||||||
my ($body, $hdr) = @_;
|
my ($body, $hdr) = @_;
|
||||||
|
|
||||||
@ -715,6 +716,16 @@ sub write_log {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub atfork_handler {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
eval {
|
||||||
|
# something else do to ?
|
||||||
|
close($self->{socket});
|
||||||
|
};
|
||||||
|
warn $@ if $@;
|
||||||
|
}
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($this, %args) = @_;
|
my ($this, %args) = @_;
|
||||||
|
|
||||||
@ -729,9 +740,8 @@ sub new {
|
|||||||
# init inotify
|
# init inotify
|
||||||
PVE::INotify::inotify_init();
|
PVE::INotify::inotify_init();
|
||||||
|
|
||||||
my $atfork = sub { close($self->{socket}); };
|
|
||||||
$self->{rpcenv} = PVE::RPCEnvironment->init(
|
$self->{rpcenv} = PVE::RPCEnvironment->init(
|
||||||
$self->{trusted_env} ? 'priv' : 'pub', atfork => $atfork);
|
$self->{trusted_env} ? 'priv' : 'pub', atfork => sub { $self-> atfork_handler() });
|
||||||
|
|
||||||
fh_nonblocking($self->{socket}, 1);
|
fh_nonblocking($self->{socket}, 1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user