Compile a send a HTML response to the HTTP client. The HTML page content is supplied as a hzString Note: This function is deprecated. Please use hzHttpEvent::SendRawChain instead
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzHttpEvent::SendRawString | (HttpRC,hzMimetype,hzString&,uint32_t,bool,) |
Declared in file: hzHttpServer.h
Defined in file : hzHttpServer.cpp
Function Logic:
Function body:
hzEcode hzHttpEvent::SendRawString (HttpRC hrc)hzMimetype type, hzString& Content, uint32_t nExpires, bool bZip,
{
// Compile a send a HTML response to the HTTP client. The HTML page content is supplied as a hzString
//
// Arguments: 1) hrc The HTTP return code to appear in the header.
// 2) type The MIME type of HTTP message
// 3) Contyent The page content
// 4) nExpires The expiry time for the page
// 5) bZip A boolean flag to indicate if the content has been zipped. It sets an indicator in the outgoing header.
//
// Returns: E_ARGUMENT If any of the arguments are invalid
// E_WRITEFAIL If the HTTP response could not be sent to the browser.
// E_OK If the operation was successful.
//
// Note: This function is deprecated. Please use hzHttpEvent::SendRawChain instead
_hzfunc("hzHttpEvent::SendRawString") ;
hzChain Z ; // For building header
hzEcode rc ; // Return code
rc = _formhead(Z, hrc, type, Content.Length(), nExpires, bZip) ;
if (rc != E_OK)
return hzerr(rc, "Could not formulate HTTP header (sock=%d)", m_pCx->CliSocket()) ;
Z << Content ;
if (m_pCx->SendData(Z) != E_OK)
{
hzerr(E_WRITEFAIL, "hzHttpEvent %p Failed to send response (size=%d, sock=%d)", this, Z.Size(), m_pCx->CliSocket()) ;
return E_WRITEFAIL ;
}
return E_OK ;
}