Return Type | Function name | Arguments |
---|---|---|
hzEcode | hzHttpEvent::Redirect | (const hzUrl&,unsigned int,bool,) |
Declared in file: hzHttpServer.h
Defined in file : hzHttpServer.cpp
Function Logic:
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 ; }