From c6ab4d998bb67369edaa4141a89d1c06c42a7e15 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 13 Feb 2013 14:10:36 +0100 Subject: [PATCH] =?utf8?q?Opendocument=20PDF=20Konvertierung=20unter=20FCG?= =?utf8?q?I=20erm=C3=B6glicht?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Forken unter FCGI muss die in/out streams gesondert behandeln. --- SL/Template/OpenDocument.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SL/Template/OpenDocument.pm b/SL/Template/OpenDocument.pm index e0523d346..f9507f9ba 100644 --- a/SL/Template/OpenDocument.pm +++ b/SL/Template/OpenDocument.pm @@ -457,10 +457,19 @@ sub spawn_openoffice { last; } + if ($::dispatcher->interface_type eq 'FastCGI') { + $::dispatcher->{request}->Detach; + } + if (!$spawned_oo) { my $pid = fork(); if (0 == $pid) { $main::lxdebug->message(LXDebug->DEBUG2(), " Child daemonizing\n"); + + if ($::dispatcher->interface_type eq 'FastCGI') { + $::dispatcher->{request}->Finish; + $::dispatcher->{request}->LastCall; + } chdir('/'); open(STDIN, '/dev/null'); open(STDOUT, '>/dev/null'); @@ -474,6 +483,11 @@ sub spawn_openoffice { "-accept=socket,host=localhost,port=" . $::lx_office_conf{print_templates}->{openofficeorg_daemon_port} . ";urp;"); exec(@cmdline); + } else { + # parent + if ($::dispatcher->interface_type eq 'FastCGI') { + $::dispatcher->{request}->Attach; + } } $main::lxdebug->message(LXDebug->DEBUG2(), " Parent after fork\n"); -- 2.20.1