Return TypeFunction nameArguments
hzEcodehzHttpEvent::Redirect(const hzUrl&,unsigned int,bool,)

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

Function Logic:

0:START 1:m_Redirect items items hzChain::Printf items 2:SendRawChain(HTTPMSG_FOUND_GOTO,HMTYPE_TXT_HTML,Z,nExpires,bZip)!=E_OK 3:hzChain::Size hzIpConnex::CliSocket 4:Return E_WRITEFAIL 5:Return E_OK

Function body:

hzEcode hzHttpEvent::Redirect (const hzUrl& url, unsigned int nExpires, bool bZip)
{
   _hzfunc("hzHttpEvent::Redirect") ;
   hzChain     Z ;
   m_Redirect = url ;
   Z << "<html>\n<head>\n<title>Moved</title>\n" ;
   Z << "</head>\n<body>\n<h1>Moved</h1>\n" ;
   Z.Printf("<p>You are being redirected. Please <a href="%s">click here</a></p>\n"  , *url) ;
   Z << "</body>\n</html>\n" ;
   if (SendRawChain(HTTPMSG_FOUND_GOTO, HMTYPE_TXT_HTML, Z, nExpires, bZip) != E_OK)
   {
       hzerr(E_WRITEFAIL, "Response data not sent (size=%d, sock=%d)", Z.Size(), m_pCx->CliSocket()) ;
       return E_WRITEFAIL ;
   }
   return E_OK ;
}