Skip to content

Commit

Permalink
fix stack overflow when destroying sesson by quota (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximthomas authored Sep 29, 2022
1 parent c69502e commit 6a01a9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class SessionNotificationHandler implements NotificationHandler {
public void process(Vector<Notification> notifications) {
for (int i = 0; i < notifications.size(); i++) {
Notification notification = notifications.elementAt(i);
processNotification(SessionNotification.parseXML(notification.getContent()));
processNotification(SessionNotification.parseXML(notification.getContent()), true);
}
}

Expand All @@ -81,7 +81,7 @@ public void process(Vector<Notification> notifications) {
*
* @param notification A SessionNotification object describing changes to the Session
*/
public void processNotification(SessionNotification notification) {
public void processNotification(SessionNotification notification, boolean remote) {
SessionInfo info = notification.getSessionInfo();

sessionDebug.message("SESSION NOTIFICATION : " + info.toXMLString());
Expand Down Expand Up @@ -116,7 +116,7 @@ public void processNotification(SessionNotification notification) {
Session.invokeListeners(evt);

//remote session
if(sessionEventType.equals(SessionEventType.EVENT_URL_ADDED) && session.getLocalSessionEventListeners().size() == 0) { //remote session
if(sessionEventType.equals(SessionEventType.EVENT_URL_ADDED) && remote) { //remote session
SessionAccessManager sessionAccessManager = InjectorHolder.getInstance(SessionAccessManager.class);
InternalSession internalSession = sessionAccessManager.getInternalSession(session.getSessionID());
if(internalSession != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ boolean sendToLocal() {
SessionInfo info = sessionInfoFactory.makeSessionInfo(event.getInternalSession(), sid);
SessionNotification notification =
new SessionNotification(info, event.getType().getCode(), event.getTime());
SessionNotificationHandler.handler.processNotification(notification);
SessionNotificationHandler.handler.processNotification(notification, false);
}
} else {
// If the Global notification is for a remote URL, it should be handled from run()
Expand Down

0 comments on commit 6a01a9b

Please sign in to comment.