On Thu, 6 May 2004, ripuda wrote:
> we have been developing a HTTP/1.1 server that will support
> cgi scripts. please any body let me know how should i get the
> output of a cgi or perl script. though, we know that these script
> program sends their output on STDOUT device but how the server
> should read or get that output
The exact solution would depend on your programming language,
libraries you can use, operating system, desired performance, and a
set of features you want to support. All of the above may affect how
one captures the output of a program from another program. For a
simple, partial, C-centric solution, consider using a popen(3) call.
There are open source servers with elaborate CGI support; in theory,
you may be able to extract the logic and specifics from Apache httpd
or another open source server.
Note that, ideally, you also want to capture and log STDERR output of
a CGI script.
None of the above is related to HTTP or HTTP compliance so you may
want to find a more appropriate venue for followup questions.
Protocol performance, functionality, and reliability testing.
Tools, services, and know-how.