Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
65a31a79
Commit
65a31a79
authored
Aug 04, 2014
by
Dave Cridland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix odd logic around new server sessions
Double-check removed, streamlining logic.
parent
877c20eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
LocalOutgoingServerSession.java
...software/openfire/session/LocalOutgoingServerSession.java
+10
-14
No files found.
src/java/org/jivesoftware/openfire/session/LocalOutgoingServerSession.java
View file @
65a31a79
...
...
@@ -118,7 +118,7 @@ public class LocalOutgoingServerSession extends LocalServerSession implements Ou
* @param hostname the hostname of the remote server.
* @return True if the domain was authenticated by the remote server.
*/
public
static
boolean
authenticateDomain
(
String
domain
,
String
hostname
)
{
public
static
boolean
authenticateDomain
(
final
String
domain
,
final
String
hostname
)
{
if
(
hostname
==
null
||
hostname
.
length
()
==
0
||
hostname
.
trim
().
indexOf
(
' '
)
>
-
1
)
{
// Do nothing if the target hostname is empty, null or contains whitespaces
return
false
;
...
...
@@ -158,19 +158,15 @@ public class LocalOutgoingServerSession extends LocalServerSession implements Ou
}
if
(
session
==
null
)
{
int
port
=
RemoteServerManager
.
getPortForServer
(
hostname
);
// No session was found to the remote server so make sure that only one is created
session
=
sessionManager
.
getOutgoingServerSession
(
hostname
);
if
(
session
==
null
)
{
session
=
createOutgoingSession
(
domain
,
hostname
,
port
);
if
(
session
!=
null
)
{
// Add the validated domain as an authenticated domain
session
.
addAuthenticatedDomain
(
domain
);
// Add the new hostname to the list of names that the server may have
session
.
addHostname
(
hostname
);
// Notify the SessionManager that a new session has been created
sessionManager
.
outgoingServerSessionCreated
((
LocalOutgoingServerSession
)
session
);
return
true
;
}
session
=
createOutgoingSession
(
domain
,
hostname
,
port
);
if
(
session
!=
null
)
{
// Add the validated domain as an authenticated domain
session
.
addAuthenticatedDomain
(
domain
);
// Add the new hostname to the list of names that the server may have
session
.
addHostname
(
hostname
);
// Notify the SessionManager that a new session has been created
sessionManager
.
outgoingServerSessionCreated
((
LocalOutgoingServerSession
)
session
);
return
true
;
}
else
{
Log
.
warn
(
"Fail to connect to {} for {}"
,
hostname
,
domain
);
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment