|
|
int Ns_ConnFlushHeaders(
Ns_Conn *conn,
int status
);
The status is a standard error code such as 403 for access denied or 200 for OK. Returns NS_OK or NS_ERROR.
This function is normally required just before sending content to the client.
/* A simple Hello request function. */
int
MyHello(Ns_Conn *conn, void *ctx)
{
char hello[] = "hello";
int len;
len = strlen(hello);
Ns_ConnSetRequiredHeaders(conn, "text/plain", len);
Ns_ConnFlushHeaders(conn, 200);
return Ns_ConnWrite(conn, hello, len);
}