Return TypeFunction nameArguments
hzTcpCodeHandleHttpMsg(hzChain&,hzIpConnex*,)

Declared and defined in file: hzIpServer.cpp

Function Logic:

0:START 1:!pCx->m_pEventHdl 2:hzexit 3:pE hzIpConnex::MsgComplete 4:pCx->MsgComplete() 5:pCx 6:pE->ProcessEvent(Input)!=E_OK 7:hzIpConnex::GetLogger hzLogger::Log hzChain::Clear 8:Return TCP_TERMINATE 9:!pE->MsgComplete() 10:pCx hzHttpEvent::ExpectSize hzIpConnex::ExpectSize 11:Return TCP_INCOMPLETE 12:pCx->m_appFn 13:fnOnHttpEvent tcp_rc 14:hzChain::Clear 15:Return tcp_rc

Function body:

hzTcpCode HandleHttpMsg (hzChain& Input, hzIpConnex* pCx)
{
   _hzfunc("HandleHttpMsg") ;
   hzTcpCode   (*fnOnHttpEvent)(hzHttpEvent*) ;
   hzHttpEvent*    pE ;
   hzTcpCode       tcp_rc ;
   if (!pCx->m_pEventHdl)
       hzexit(E_MEMORY, "Could not allocate a HTTP Event") ;
   pE = (hzHttpEvent*) pCx->m_pEventHdl ;
   if (pCx->MsgComplete())
       pCx->m_pEventHdl = 0;
   if (pE->ProcessEvent(Input) != E_OK)
   {
       pCx->GetLogger()->Log("Deleting failed HTTP event input\n") ;
       Input.Clear() ;
       return TCP_TERMINATE ;
   }
   if (!pE->MsgComplete())
   {
       pCx->m_pEventHdl = pE ;
       pCx->ExpectSize(pE->ExpectSize()) ;
       return TCP_INCOMPLETE ;
   }
   if (pCx->m_appFn)
   {
       fnOnHttpEvent = (hzTcpCode(*)(hzHttpEvent*)) pCx->m_appFn ;
       tcp_rc = fnOnHttpEvent(pE) ;
   }
   Input.Clear() ;
   return tcp_rc ;
}