iTP Secure WebServer System Administrator's Guide (iTPWebSvr 5.1+)
Using Common Gateway Interface (CGI) Programs
iTP Secure WebServer System Administrator’s Guide—522659-001
8-31
Pathway CGI Coding Considerations
Pathway CGI Coding Considerations
The considerations for coding a Pathway CGI application include requirements for
including the CGI library and design guidelines for the NonStop TS/MP execution
environment.
Including the CGI Library
Your application must include the cgilib.h file, illustrated in Example 8-2. If the
application consists of multiple modules, all except the CGI_main module should
precede the include using the following define:
#define _CGI_NO_EXTERNALS
CGI_connection_abort This stub procedure is called whenever the connection between the
CGI server and the httpd program is broken; usually, when the end
user at the web client stops an active data transfer prior to
receiving all the data being sent, or when there is an internal
timeout within the httpd server itself, in the case where a single
connection has existed longer than its configured lifetime.
The intent of a user-coded connection abort routine is to allow for
graceful cleanup of transactions in progress.
CGI_initialize() This stub procedure is called each time the server comes up to
allow user-written initialization code (such as opening database
files) to be executed at startup time.
CGI_terminate This stub procedure is called before the server stops or aborts to
allow user-written cleanup code to be executed prior to process
termination.
Table 8-6. CGI Procedures (page 3 of 3)
Procedure Description