mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-07 22:03:50 +00:00
clean up forking code in example
This commit is contained in:
parent
172e4a3041
commit
e7b4821844
@ -61,11 +61,17 @@ my $xml = qq#
|
|||||||
</document>
|
</document>
|
||||||
#;
|
#;
|
||||||
|
|
||||||
|
$SIG{CHLD} = "IGNORE";
|
||||||
|
|
||||||
while (my $request = $scgi->accept) {
|
while (my $request = $scgi->accept) {
|
||||||
|
|
||||||
# fork every new req into its own process (optional)
|
# fork every new req into its own process (optional)
|
||||||
next unless(my $pid = fork());
|
my $pid = fork();
|
||||||
|
|
||||||
|
if ($pid) {
|
||||||
|
$request->close();
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
my $handle = $request->connection;
|
my $handle = $request->connection;
|
||||||
|
|
||||||
$request->read_env;
|
$request->read_env;
|
||||||
@ -89,5 +95,9 @@ while (my $request = $scgi->accept) {
|
|||||||
#print $handle "Content-Type: text/xml\n\n";
|
#print $handle "Content-Type: text/xml\n\n";
|
||||||
|
|
||||||
print $handle $xml;
|
print $handle $xml;
|
||||||
exit if (!$pid);
|
|
||||||
|
exit unless $pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user