•
Remove existing
content-type
•
Create any other headers in
•
Call
•
Call
•
Generate and send data to the client using
•
Return
other failures.
Error SAFs
•
Purpose: Respond to an HTTP status error condition.
•
The Error SAF is only called if each of the optional parameters
reason
•
Error SAFs do the same as Service SAFs, but only in response to an HTTP
status error condition.
AddLog SAFs
•
Purpose: Log the transaction to a log file.
•
AddLog
•
Return
CGI to NSAPI Conversion
You may have a need to convert a CGI variable into a SAF using NSAPI. Since the
CGI environment variables are not available to NSAPI, you'll retrieve them from
the NSAPI parameter blocks. The table below indicates how each CGI environment
variable can be obtained in NSAPI.
Keep in mind that your code must be thread-safe under NSAPI. You should use
NSAPI functions which are thread-safe. Also, you should use the NSAPI memory
management and other routines for speed and platform independence.
content-type
in
rq->srvhdrs
to set HTTP response status.
protocol_status
protocol_start_response
if successful,
REQ_PROCEED
specified in the directive in
SAFs can use any data available in
.
REQ_PROCEED
from
rq->srvhdrs
.
.
rq->srvhdrs
to send HTTP response and headers.
net_write
on write error,
REQ_EXIT
match the current error.
obj.conf
,
, or
pb
sn
Chapter 4
CGI to NSAPI Conversion
. Insert correct
.
REQ_ABORTED
and
code
to log this transaction.
rq
Creating Custom SAFs
on
131