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
f363143c
Commit
f363143c
authored
Dec 12, 2016
by
Dave Cridland
Committed by
GitHub
Dec 12, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #632 from surevine/routing
OF-1171 Update message routing to RFC 6120
parents
12b4559b
5ee189d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
RoutingTableImpl.java
src/java/org/jivesoftware/openfire/spi/RoutingTableImpl.java
+24
-4
No files found.
src/java/org/jivesoftware/openfire/spi/RoutingTableImpl.java
View file @
f363143c
...
@@ -546,6 +546,18 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable, Clust
...
@@ -546,6 +546,18 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable, Clust
// Get the sessions with non-negative priority for message carbons processing.
// Get the sessions with non-negative priority for message carbons processing.
List
<
ClientSession
>
nonNegativePrioritySessions
=
getNonNegativeSessions
(
sessions
,
0
);
List
<
ClientSession
>
nonNegativePrioritySessions
=
getNonNegativeSessions
(
sessions
,
0
);
if
(
packet
.
getType
()
==
Message
.
Type
.
error
)
{
// Errors should be dropped at this point.
Log
.
debug
(
"Error stanza to bare JID discarded: {}"
,
packet
.
toXML
());
return
true
;
// Not offline.
}
if
(
packet
.
getType
()
==
Message
.
Type
.
groupchat
)
{
// Surreal message type; cannot occur.
Log
.
debug
(
"Groupchat stanza to bare JID discarded: {}"
,
packet
.
toXML
());
return
false
;
// Maybe offline has an idea?
}
if
(
nonNegativePrioritySessions
.
isEmpty
())
{
if
(
nonNegativePrioritySessions
.
isEmpty
())
{
// No session is available so store offline
// No session is available so store offline
Log
.
debug
(
"Unable to route packet. No session is available so store offline. {} "
,
packet
.
toXML
());
Log
.
debug
(
"Unable to route packet. No session is available so store offline. {} "
,
packet
.
toXML
());
...
@@ -554,8 +566,11 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable, Clust
...
@@ -554,8 +566,11 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable, Clust
// Check for message carbons enabled sessions and send the message to them.
// Check for message carbons enabled sessions and send the message to them.
for
(
ClientSession
session
:
nonNegativePrioritySessions
)
{
for
(
ClientSession
session
:
nonNegativePrioritySessions
)
{
if
(
packet
.
getType
()
==
Message
.
Type
.
headline
)
{
// Headline messages are broadcast.
session
.
process
(
packet
);
// Deliver to each session, if is message carbons enabled.
// Deliver to each session, if is message carbons enabled.
if
(
shouldCarbonCopyToResource
(
session
,
packet
,
isPrivate
))
{
}
else
if
(
shouldCarbonCopyToResource
(
session
,
packet
,
isPrivate
))
{
session
.
process
(
packet
);
session
.
process
(
packet
);
// Deliver to each session if property route.really-all-resources is true
// Deliver to each session if property route.really-all-resources is true
// (in case client does not support carbons)
// (in case client does not support carbons)
...
@@ -563,9 +578,14 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable, Clust
...
@@ -563,9 +578,14 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable, Clust
session
.
process
(
packet
);
session
.
process
(
packet
);
}
}
}
}
if
(
JiveGlobals
.
getBooleanProperty
(
"route.really-all-resources"
,
false
))
if
(
packet
.
getType
()
==
Message
.
Type
.
headline
)
{
return
true
;
return
true
;
}
if
(
JiveGlobals
.
getBooleanProperty
(
"route.really-all-resources"
,
false
))
{
return
true
;
}
// Get the highest priority sessions for normal processing.
// Get the highest priority sessions for normal processing.
List
<
ClientSession
>
highestPrioritySessions
=
getHighestPrioritySessions
(
nonNegativePrioritySessions
);
List
<
ClientSession
>
highestPrioritySessions
=
getHighestPrioritySessions
(
nonNegativePrioritySessions
);
...
...
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