Skip to content

Commit

Permalink
OF-2608: Do not wait for Dialback response if connection is closed
Browse files Browse the repository at this point in the history
While waiting for a response to a Dialback request, Openfire should terminate when the underlying connection is closed.
  • Loading branch information
guusdk committed Jun 26, 2023
1 parent 138f4b9 commit 219963d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ public void run() {
thread.start();
}

public boolean isOpen() {
return open;
}

private void closeSession() {
open = false;
if (session != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public boolean authenticateDomain(OutgoingServerSocketReader socketReader, Strin

// Process the answer from the Receiving Server
try {
while (true) {
while (socketReader.isOpen()) {
Element doc = socketReader.getElement(RemoteServerManager.getSocketTimeout(), TimeUnit.MILLISECONDS);
if (doc == null) {
log.debug( "Failed to authenticate domain: Time out waiting for validation response." );
Expand All @@ -349,6 +349,7 @@ else if ("db".equals(doc.getNamespacePrefix()) && "result".equals(doc.getName())
log.debug( "Failed to authenticate domain: An interrupt was received while waiting for validation response (is Openfire shutting down?)" );
return false;
}
return false;
}
}

Expand Down

0 comments on commit 219963d

Please sign in to comment.