Query: ns_connflushheaders
OS: debian
Section: 3aolserv
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Ns_ConnQueueHeaders(3aolserver) AOLserver Library Procedures Ns_ConnQueueHeaders(3aolserver) __________________________________________________________________________________________________________________________________________________NAMENs_ConnQueueHeaders, Ns_ConnFlushHeaders - Routines to construct send HTTP response headersSYNOPSIS#include "ns.h" void Ns_ConnFlushHeaders(conn, status) void Ns_ConnQueueHeaders(conn, status)ARGUMENTSNs_Conn conn (in) Pointer to open connection. int status (in) HTTP response status. _________________________________________________________________DESCRIPTIONThese function format headers pending in the outputheaders Ns_Set 0fRtto indicatenendsofoheaders.ture to be sent to the client. The head- ers d0fR separators betweeneheaderTkey:evalueepairs andhattrailing status code (e.g., "HTTP/1.1 200 OK") is formatted as a single string with int Ns_ConnFlushHeaders(conn) This routine constructs the headers and then attempts to send them immediately to the client. The result is either NS_OK if the content was sent, NS_ERROR otherwise. void Ns_ConnQueueHeaders(conn) This routine constructs the headers as with Ns_ConnFlushHeaders but does not send the data to the client. Instead, the resulting headers string is stored in an internal buffer to be sent later on the first call to Ns_ConnSend. Delaying the flush of the content helps increase performance by providing the opportunity to combine the headers and content responses into a single system call. Note that higher level routines which generate complete responses such as the Ns_ConnReturn routines or Ns_ConnFlush call Ns_ConnQueueHead- ers automatically as needed. Only custom code which constructs headers manually and sends content directly must include a call to Ns_Con- nQueueHeaders or Ns_ConnFlushHeaders before generating the output content.EXAMPLESThe following example demonstrates a simple response. In this case, the headers are queued and sent with the small "hello" message on the call to Ns_ConnPuts which internally calls Ns_ConnSend: Ns_ConnSetRequiredHeaders(conn, "text/plain", 5); Ns_ConnQueueHeaders(conn, 200); Ns_ConnPuts(conn, "hello");SEE ALSONs_ConnSetHeaders(3), Ns_ConnSend(3)KEYWORDSconnection, headers AOLserver 4.0 Ns_ConnQueueHeaders(3aolserver)
Related Man Pages |
---|
ns_connflushdirect(3aolserv) - debian |
ns_connflushheaders(3aolserv) - debian |
ns_conngetstatus(3aolserv) - debian |
ns_connsend(3aolserv) - debian |
ns_connsetheaders(3aolserv) - debian |
Similar Topics in the Unix Linux Community |
---|
change field content awk |
Merging of files with different headers to make combined headers file |
How to know the status of a Command? |