-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
OF-1927: Show TCP port for server-to-server (S2S) connections in admin console #3233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright (C) 2007-2009 Jive Software, 2021-2023 Ignite Realtime Foundation. All rights reserved. | ||
| * Copyright (C) 2007-2009 Jive Software, 2021-2026 Ignite Realtime Foundation. All rights reserved. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file doesn't seem to be modified. We don't need to change the copyright year when the file not changed. |
||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright (C) 2007-2009 Jive Software, 2021-2025 Ignite Realtime Foundation. All rights reserved. | ||
| * Copyright (C) 2007-2009 Jive Software, 2021-2026 Ignite Realtime Foundation. All rights reserved. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
|
|
@@ -51,6 +51,7 @@ public abstract class RemoteSession implements Session { | |
| private String serverName; | ||
| private String hostAddress; | ||
| private String hostName; | ||
| private int remotePort = -1; | ||
|
|
||
| public RemoteSession(byte[] nodeID, JID address) { | ||
| this.nodeID = nodeID; | ||
|
|
@@ -180,6 +181,17 @@ public String getHostName() throws UnknownHostException { | |
| return hostName; | ||
| } | ||
|
|
||
| @Override | ||
| public int getRemotePort() { | ||
| if (remotePort == -1) { | ||
| ClusterTask<Object> task = getRemoteSessionTask(RemoteSessionTask.Operation.getRemotePort); | ||
| Object result = doSynchronousClusterTask(task); | ||
| remotePort = result == null ? 0 : (Integer) result; | ||
| } | ||
| return remotePort; | ||
|
Comment on lines
+186
to
+191
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don’t permanently cache an unavailable remote port. At Line 189, Proposed minimal fix `@Override`
public int getRemotePort() {
if (remotePort == -1) {
ClusterTask<Object> task = getRemoteSessionTask(RemoteSessionTask.Operation.getRemotePort);
Object result = doSynchronousClusterTask(task);
- remotePort = result == null ? 0 : (Integer) result;
+ if (result != null) {
+ remotePort = (Integer) result;
+ }
}
- return remotePort;
+ return remotePort == -1 ? 0 : remotePort;
}🤖 Prompt for AI Agents
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MilanTyagi2004 I suggest that you apply the proposed minimal fix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this still needs to be done? |
||
| } | ||
|
|
||
|
|
||
| public void deliverRawText(String text) { | ||
| doClusterTask(getDeliverRawTextTask(text)); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright (C) 2005-2008 Jive Software, 2017-2025 Ignite Realtime Foundation. All rights reserved. | ||
| * Copyright (C) 2005-2008 Jive Software, 2017-2026 Ignite Realtime Foundation. All rights reserved. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
|
|
@@ -195,6 +195,15 @@ default boolean isAuthenticated() { | |
| * @throws java.net.UnknownHostException if IP address of host could not be determined. | ||
| */ | ||
| String getHostAddress() throws UnknownHostException; | ||
|
|
||
| /** | ||
| * Returns the remote port used by the connection. | ||
| * | ||
| * @return the remote port, or 0 when unavailable. | ||
| */ | ||
| default int getRemotePort() { | ||
| return 0; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Throughout the code, there are two different values used to represent a 'unknown' remote port:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this still needs to be done? |
||
| } | ||
|
Fishbowler marked this conversation as resolved.
|
||
|
|
||
| /** | ||
| * Gets the host name for this IP address. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.