Send a HTTP response code only. Note: This function should only be invoked in response to AJAX HTTP requests

Return TypeFunction nameArguments
hzEcodehzHttpEvent::SendAjaxResult(HttpRC,)

Declared in file: hzHttpServer.h
Defined in file : hzHttpServer.cpp

Function Logic:

0:START 1:rc 2:unknown 3:items 4:Return rc 5:unknown 6:items 7:Return E_WRITEFAIL 8:Return E_OK

Function body:

hzEcode hzHttpEvent::SendAjaxResult (HttpRC hrc)
{
   //  Send a HTTP response code only.
   //  
   //  Note: This function should only be invoked in response to AJAX HTTP requests
   //  
   //  Arguments: 1) hrc   HTTP return code
   //  
   //  Returns: E_WRITEFAIL If the response could not be sent
   //     E_OK  If the AJAX result was sent
   _hzfunc("hzHttpEvent::SendCmdResult(1)") ;
   hzChain Z ;     //  For building header
   hzEcode rc ;    //  Return code
   rc = _formhead(Z, hrc, HMTYPE_TXT_HTML, 0,0,false) ;
   if (rc != E_OK)
   {
       hzerr(rc, "Could not formulate HTTP header (sock=%d)", m_pCx->CliSocket()) ;
       return rc ;
   }
   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 ;
}