/** ** Initialize the session and server configurations for this packet/stream. ** ** It is important to note in stateless mode that we assume no knowledge of the ** state of a connection, other than the knowledge that we can glean from an ** individual packet. So in essence, each packet is it's own session and there ** is no knowledge retained from one packet to another. If you want to track ** an HTTP session for real, use stateful mode. ** ** In this function, we set the Session pointer (which includes the correct ** server configuration). The actual processing to find which IP is the ** server and which is the client, is done in the InitServerConf() function. ** ** @param GlobalConf pointer to the global configuration ** @param Session double pointer to the Session structure ** @param SiInput pointer to the session information ** @param piInspectMode pointer so the inspection mode can be set ** ** @return integer ** ** @retval HI_SUCCESS function successful */ static int StatelessSessionInspection(HTTPINSPECT_GLOBAL_CONF *GlobalConf, HI_SESSION **Session, HI_SI_INPUT *SiInput, int *piInspectMode, Packet *p) { static HI_SESSION StaticSession; HTTPINSPECT_CONF *ServerConf = NULL; HTTPINSPECT_CONF *ClientConf = NULL; int iRet; ResetSession(&StaticSession); iRet = InitServerConf(GlobalConf, &ServerConf, &ClientConf, SiInput, piInspectMode, p); if (iRet) { return iRet; } StaticSession.server_conf = ServerConf; StaticSession.client_conf = ClientConf; StaticSession.global_conf = GlobalConf; *Session = &StaticSession; return HI_SUCCESS; }
//----------------------------------------------------------------------------- // Purpose: CSession class //----------------------------------------------------------------------------- CSession::CSession() { m_pParent = NULL; m_hSession = INVALID_HANDLE_VALUE; m_SessionState = SESSION_STATE_NONE; m_pRegistrationResults = NULL; ResetSession(); }
/** @brief Convert the HTTP status code to MMI status code for Close. * * @param[in] HTTPStatus - HTTP streamer status code * @param[in] pUserData - Reference to the registered MMI callback iface */ void HTTPSourceMMIHelper::ProcessCloseStatus ( const HTTPDownloadStatus HTTPStatus, void* pUserData ) { bool bOk = true; OMX_U32 ret = MMI_S_EBADPARAM; switch (HTTPStatus) { case HTTPCommon::HTTPDL_ERROR_ABORT: ret = MMI_S_EFAIL; break; case HTTPCommon::HTTPDL_TIMEOUT: ret = MMI_S_ETIMEOUT; break; case HTTPCommon::HTTPDL_OUT_OF_MEMORY: ret = MMI_S_ENOSWRES; break; case HTTPCommon::HTTPDL_UNSUPPORTED: ret = MMI_S_ENOTIMPL; break; case HTTPCommon::HTTPDL_SUCCESS: //Close successful ret = MMI_S_COMPLETE; break; default: //Ignore other events bOk = false; break; } m_pHTTPSourceMMI->m_pHTTPSourceMMIExtensionHandler.NotifyQOEEvent(QOMX_HTTP_IndexParamQOEStop); if (bOk) { ResetSession(); } NotifyMmi(MMI_RESP_STOP, ret, 0, NULL, pUserData); return; }
CSession::~CSession() { ResetSession(); }