iTP Secure WebServer System Administrator's Guide (iTPWebSvr 5.1+)

Using Common Gateway Interface (CGI) Programs
iTP Secure WebServer System Administrators Guide522659-001
8-4
Pathway CGI Server classes
Pathway CGI Server classes
Pathway CGI server classes provides substantial improvement in performance by
comparison with conventional or generic-CGI, because the CGI program is implemented
not as a separate process, but as a user-written CGI_main procedure within a NonStop
TS/MP server process. To create a Pathway CGI server class, you use the CGI library, as
follows:
Use the following library routines, rather than the corresponding C library routines,
for access to the standard input, output, and error files:
CGI_fread
CGI_fwrite
CGI_printf
CGI_getc
CGI_puts
Use other CGI procedures as required by your application. Table 8-6 on page 8-29
lists and describes all the procedures in the CGI library.
The semantics of CGI routines are identical to the corresponding routines in the
standard C library.
Link your application code with the CGI library, libcgi.a, to create an executable
program.
The CGI library uses the context-sensitive Pathsend interface, as shown in Figure 8-3
.
The Pathway CGI interface simulates the behavior of the OSS standard input, output,
and error files.
Note. Applications built using a version of libcgi.a that is newer than the version of the iTP
Secure WebServer (httpd process) might not run correctly in the older WebServer
environment. Applications built with a previous version of libcgi.a run correctly with newer
versions of the iTP Secure WebServer.
Note. CGI requests and replies can be of any length. For long requests and replies, the httpd
process and the process labeled “Pathway CGI main” exchange multiple Serverclass_send
and reply messages.