void EAbstractProxyIoHandler::sessionOpened(sp<EIoSession>& session) {
	sp<EProxyIoSession> proxyIoSession = dynamic_pointer_cast<EProxyIoSession>(session->getAttribute(EProxyIoSession::PROXY_SESSION.get()));

	if (instanceof<ESocksProxyRequest>(proxyIoSession->getRequest().get()) || proxyIoSession->isAuthenticationFailed()
			|| proxyIoSession->getHandler()->isHandshakeComplete()) {
		proxySessionOpened(session);
	} else {
		logger->debug(__FILE__, __LINE__, "Filtered session opened event !");
	}
}
Example #2
0
void EProxyFilter::exceptionCaught(EIoFilter::NextFilter* nextFilter,
		sp<EIoSession>& session, sp<EThrowableType>& cause) {
	sp<EProxyIoSession> proxyIoSession = dynamic_pointer_cast<EProxyIoSession>(session->getAttribute(EProxyIoSession::PROXY_SESSION.get()));
	proxyIoSession->setAuthenticationFailed(true);
	EIoFilterAdapter::exceptionCaught(nextFilter, session, cause);
}
Example #3
0
void EProxyFilter::sessionClosed(EIoFilter::NextFilter* nextFilter,
		sp<EIoSession>& session) {
	sp<EProxyIoSession> proxyIoSession = dynamic_pointer_cast<EProxyIoSession>(session->getAttribute(EProxyIoSession::PROXY_SESSION.get()));
	proxyIoSession->getEventQueue()->enqueueEventIfNecessary(
			new EIoSessionEvent(nextFilter, session, EIoSessionEventType::CLOSED));
}
Example #4
0
void EProxyFilter::sessionIdle(EIoFilter::NextFilter* nextFilter,
		sp<EIoSession>& session, EIdleStatus status) {
	sp<EProxyIoSession> proxyIoSession = dynamic_pointer_cast<EProxyIoSession>(session->getAttribute(EProxyIoSession::PROXY_SESSION.get()));
	proxyIoSession->getEventQueue()->enqueueEventIfNecessary(new EIoSessionEvent(nextFilter, session, status));
}
Example #5
0
void EProxyFilter::sessionOpened(EIoFilter::NextFilter* nextFilter,
		sp<EIoSession>& session) {
	sp<EProxyIoSession> proxyIoSession = dynamic_pointer_cast<EProxyIoSession>(session->getAttribute(EProxyIoSession::PROXY_SESSION.get()));
	proxyIoSession->getEventQueue()->enqueueEventIfNecessary(
			new EIoSessionEvent(nextFilter, session, EIoSessionEventType::OPENED)); //TODO: if enqueue fail then need free it!
}