Ns_ConnGetStatus, Ns_ConnSetStatus
Routines to manage the HTTP response status
- Provided by: aolserver4-dev (Version: 4.5.1-18)
- Source: aolserver4
- Report a bug
Routines to manage the HTTP response status
#include "ns.h" int Ns_ConnGetStatus(conn) void Ns_ConnSetStatus(conn, status)
These routines manage the HTTP response code sent to the client in a later call to Ns_ConnFlush or Ns_ConnFlushDirect. Higher level routines such as the Ns_ConnReturn functions normally call these routines automatically using standard HTTP status codes and the Ns_ConnQueueHeaders routine can be used to set the status code for lower level code which bypasses Ns_ConnFlush.
The following example demonstrates setting an odd status code followed by a call to Ns_ConnFlushDirect to send some data:
Ns_ConnSetStatus(conn, 600); Ns_ConnSetType(conn, "text/plain"); Ns_ConnFlushDirect(conn, "hello", 5, 0);
The following should provide similar results:
Ns_ConnSetRequiredHeaders(conn, "text/plain", 5); Ns_ConnQueueHeaders(conn, 600); Ns_ConnPuts(conn, "hello"); Ns_ConnClose(conn);
Ns_ConnGetType(3), Ns_ConnSetType(3), Ns_ConnFlush(3), Ns_ConnFlushDirect(3), Ns_ConnSetRequiredHeaders(3), Ns_ConnQueueHeaders(3), ns_conn(n)
connectionn, response, status