tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32854] New: - CGIServlet waits for child process to be finished. (using fork in perl cgi)
Date Tue, 28 Dec 2004 06:51:20 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32854>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32854

           Summary: CGIServlet waits for child process to be finished.
                    (using fork in perl cgi)
           Product: Tomcat 5
           Version: 5.5.6
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Servlets:CGI
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: mk_tomcat_dev@yahoo.co.jp


Hi...

I want to work this perl script which forks off a process which does something. 
But I encountered the problem of my browser waiting for
the child process to be finished.

  Here's my script
  #!/usr/bin/perl
  if (my $child = fork) {
      // output html code
      close(STDOUT);
      wait;
  }
  elsif (defined $child) {
      close(STDOUT);
      // the child process does somethig for a few minutes
  }
  else {
      die "Can't fork\n";
  }

I have a pathch ready and it looks like this.
*** CGIServlet.java.r1.31
--- CGIServlet.java
*** 1835,1844 ****
--- 1835,1851 ----
              if (servletContainerStdout != null) {
                  servletContainerStdout.flush();
              }
          }

+       // Close the output stream used
+       if (isBinaryContent) {
+           cgiOutput.close();
+       } else {
+           commandsStdOut.close();
+       }
+
          proc.exitValue(); // Throws exception if alive

          isRunning = false;

      } catch (IllegalThreadStateException e) {

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message