Sun Java System Web Server 6.1 SP6 NSAPI Programmer's Guide


The protocol_start_response function initiates the HTTP response for a specified session and request. If the protocol version is HTTP/0.9, the function does nothing, because that version has no concept of status. If the protocol version is HTTP/1.0, the function sends a status line followed by the response headers. Use this function to set up HTTP and prepare the client and server to receive the body (or data) of the response.


int protocol_start_response(Session *sn, Request *rq);


The constant REQ_PROCEED if the operation succeeded, in which case you should send the data you were preparing to send.

The constant REQ_NOACTION if the operation succeeded but the request method was HEAD, in which case no data should be sent to the client.

The constant REQ_ABORTED if the operation did not succeed.


Session *sn is the Session.

Request *rq is the Request.

The Session and Request parameters are the same as the ones passed into your SAF.


/* A noaction response from this function means the request 
was HEAD */if (protocol_start_response(sn, rq) == REQ_NOACTION) 
filebuf_close(groupbuf);  /* close our file*/    return REQ_PROCEED;}

See Also