Result Codes
Chapter
4
Creating Custom SAFs
115
Result Codes
Upon completion, a SAF returns a result code. The result code indicates what the
server should do next. The result codes are:
•
REQ_PROCEED
indicates that the SAF achieved its objective. For some request-response steps
(AuthTrans, NameTrans, Service, and Error), this tells the server to proceed to
the next request-response step, skipping any other SAFs in the current step. For
the other request-response steps (PathCheck, ObjectType, and AddLog), the
server proceeds to the next SAF in the current step.
•
REQ_NOACTION
indicates the SAF took no action. The server continues with the next SAF in the
current server step.
•
REQ_ABORTED
indicates that an error occurred and an HTTP response should be sent to the
client to indicate the cause of the error. A SAF returning
REQ_ABORTED
should
also set the HTTP response status code. If the server finds an
Error
directive
matching the status code or reason phrase, it executes the SAF specified. If not,
the server sends a default HTTP response with the status code and reason
phrase plus a short HTML page reflecting the status code and reason phrase
for the user. The server then goes to the first
AddLog
directive.
•
REQ_EXIT
indicates the connection to the client was lost. This should be returned when
the SAF fails in reading or writing to the client. The server then goes to the first
AddLog
directive.
Creating and Using Custom SAFs
Custom SAFs are functions in shared libraries that are loaded and called by the
server. Follow these steps to create a custom SAF:
1.
Write the Source Code
using the NSAPI functions. Each SAF is written for a specific directive.
2.
Compile and Link
the source code to create a shared library (
.so, .sl,
or
.dll)
file.
Summary of Contents for ENTERPRISE SERVER 6.0
Page 1: ...NSAPI Programmer s Guide Netscape Enterprise Server Version6 0 November 2001...
Page 134: ...CGI to NSAPI Conversion 134 Netscape Enterprise Server NSAPI Programmer s Guide November 2001...
Page 306: ...cinfo 306 Netscape Enterprise Server NSAPI Programmer s Guide November 2001...
Page 312: ...Sample MIME Types File 312 Netscape Enterprise Server NSAPI Programmer s Guide November 2001...
Page 324: ...Buffered Streams 324 Netscape Enterprise Server NSAPI Programmer s Guide November 2001...
Page 332: ...332 Netscape Enterprise Server NSAPI Programmer s Guide November 2001...
Page 340: ...340 Netscape Enterprise Server NSAPI Programmer s Guide November 2001...
Page 346: ...346 Netscape Enterprise Server NSAPI Programmer s Guide November 2001...
Page 352: ...352 Netscape Enterprise Server NSAPI Programmer s Guide November 2001...