You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Robert Poskrobek <ro...@tpg.pl> on 2001/11/21 12:19:04 UTC

Problem with CGIServlet

Hi!
I've got Tomcat 4.0.1 for Windows and it's propertly configured to support
CGI programs.
Below a trivial c++ cgi program is shown. This program never ends, cause of
a stdout problem. I analyzed a lot of situations and I discoved that only
way to exit is to add '_exit(0);' function call at the end of program.
However '_exit' doesn't wait for any buffer flush or cleanup and response
data are not sent.



void main(char* argv[], int argc)
{
  printf("Content-type: text/html\n\n");

  for (int i=0; i<500; i++)
     printf("a");

  fflush(stdout);
}

Robert Poskrobek


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>