]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
add tls_ctx to proxy requests
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 11 Apr 2013 06:31:42 +0000 (08:31 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 11 Apr 2013 06:53:35 +0000 (08:53 +0200)
and fix a typo

PVE/HTTPServer.pm

index 33cb7ef91eb4ad4e9f0cbc65ac52ec26af044142..99103ce000a24ac20031e061573c5c756abccff9 100755 (executable)
@@ -282,8 +282,9 @@ sub proxy_request {
            $method => $target,
            headers => $headers,
            timeout => 30,
-           resurse => 0,
+           recurse => 0,
            body => $content,
+           tls_ctx => $self->{tls_ctx},
            sub {
                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 {
     my ($this, %args) = @_;
 
@@ -729,9 +740,8 @@ sub new {
     # init inotify
     PVE::INotify::inotify_init();
 
-    my $atfork = sub { close($self->{socket}); };
     $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);