Skip to content

Optionally close incoming connection when Session is not enabled #390

@chrjohn

Description

@chrjohn

Follow up to #360 where an incoming connection is rejected via a Logout message when the session is not enabled.

It should also be possible to just close the incoming connection in AcceptorIoHandler when the session's enabled flag is false. Probably it would be best if this was configurable.

protected void processMessage(IoSession protocolSession, Message message) throws Exception {
Session qfSession = (Session) protocolSession.getAttribute(SessionConnector.QF_SESSION);
if (qfSession == null) {
final Optional<String> msgTypeField = message.getHeader().getOptionalString(MsgType.FIELD);
if (msgTypeField.isPresent() && msgTypeField.get().equals(MsgType.LOGON)) {
final SessionID sessionID = MessageUtils.getReverseSessionID(message);
qfSession = sessionProvider.getSession(sessionID, eventHandlingStrategy.getSessionConnector());
if (qfSession != null) {

...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions