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
7bbfb9db
Commit
7bbfb9db
authored
Jan 11, 2015
by
Florian Schmaus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make conn final in LocalSession
and remove null checks. Related to OF-855.
parent
b1599c97
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
19 deletions
+10
-19
HttpSession.java
src/java/org/jivesoftware/openfire/http/HttpSession.java
+1
-2
LocalClientSession.java
...org/jivesoftware/openfire/session/LocalClientSession.java
+1
-8
LocalConnectionMultiplexerSession.java
...e/openfire/session/LocalConnectionMultiplexerSession.java
+1
-1
LocalOutgoingServerSession.java
...software/openfire/session/LocalOutgoingServerSession.java
+1
-1
LocalSession.java
src/java/org/jivesoftware/openfire/session/LocalSession.java
+6
-7
No files found.
src/java/org/jivesoftware/openfire/http/HttpSession.java
View file @
7bbfb9db
...
@@ -134,8 +134,7 @@ public class HttpSession extends LocalClientSession {
...
@@ -134,8 +134,7 @@ public class HttpSession extends LocalClientSession {
public
HttpSession
(
PacketDeliverer
backupDeliverer
,
String
serverName
,
InetAddress
address
,
public
HttpSession
(
PacketDeliverer
backupDeliverer
,
String
serverName
,
InetAddress
address
,
StreamID
streamID
,
long
rid
,
HttpConnection
connection
)
{
StreamID
streamID
,
long
rid
,
HttpConnection
connection
)
{
super
(
serverName
,
null
,
streamID
);
super
(
serverName
,
new
HttpVirtualConnection
(
address
),
streamID
);
conn
=
new
HttpVirtualConnection
(
address
);
this
.
isClosed
=
false
;
this
.
isClosed
=
false
;
this
.
lastActivity
=
System
.
currentTimeMillis
();
this
.
lastActivity
=
System
.
currentTimeMillis
();
this
.
lastRequestID
=
rid
;
this
.
lastRequestID
=
rid
;
...
...
src/java/org/jivesoftware/openfire/session/LocalClientSession.java
View file @
7bbfb9db
...
@@ -854,14 +854,7 @@ public class LocalClientSession extends LocalSession implements ClientSession {
...
@@ -854,14 +854,7 @@ public class LocalClientSession extends LocalSession implements ClientSession {
@Override
@Override
public
void
deliver
(
Packet
packet
)
throws
UnauthorizedException
{
public
void
deliver
(
Packet
packet
)
throws
UnauthorizedException
{
if
(
conn
!=
null
)
{
conn
.
deliver
(
packet
);
conn
.
deliver
(
packet
);
}
else
{
// invalid session; clean up and retry delivery (offline)
Log
.
error
(
"Failed to deliver packet to invalid session (no connection); will retry"
);
sessionManager
.
removeSession
(
this
);
XMPPServer
.
getInstance
().
getPacketDeliverer
().
deliver
(
packet
);
}
}
}
@Override
@Override
...
...
src/java/org/jivesoftware/openfire/session/LocalConnectionMultiplexerSession.java
View file @
7bbfb9db
...
@@ -302,7 +302,7 @@ public class LocalConnectionMultiplexerSession extends LocalSession implements C
...
@@ -302,7 +302,7 @@ public class LocalConnectionMultiplexerSession extends LocalSession implements C
@Override
@Override
void
deliver
(
Packet
packet
)
throws
UnauthorizedException
{
void
deliver
(
Packet
packet
)
throws
UnauthorizedException
{
if
(
conn
!=
null
&&
!
conn
.
isClosed
())
{
if
(!
conn
.
isClosed
())
{
conn
.
deliver
(
packet
);
conn
.
deliver
(
packet
);
}
}
}
}
...
...
src/java/org/jivesoftware/openfire/session/LocalOutgoingServerSession.java
View file @
7bbfb9db
...
@@ -611,7 +611,7 @@ public class LocalOutgoingServerSession extends LocalServerSession implements Ou
...
@@ -611,7 +611,7 @@ public class LocalOutgoingServerSession extends LocalServerSession implements Ou
@Override
@Override
void
deliver
(
Packet
packet
)
throws
UnauthorizedException
{
void
deliver
(
Packet
packet
)
throws
UnauthorizedException
{
if
(
conn
!=
null
&&
!
conn
.
isClosed
())
{
if
(!
conn
.
isClosed
())
{
conn
.
deliver
(
packet
);
conn
.
deliver
(
packet
);
}
}
}
}
...
...
src/java/org/jivesoftware/openfire/session/LocalSession.java
View file @
7bbfb9db
...
@@ -75,7 +75,7 @@ public abstract class LocalSession implements Session {
...
@@ -75,7 +75,7 @@ public abstract class LocalSession implements Session {
/**
/**
* The connection that this session represents.
* The connection that this session represents.
*/
*/
protected
Connection
conn
;
protected
final
Connection
conn
;
protected
SessionManager
sessionManager
;
protected
SessionManager
sessionManager
;
...
@@ -101,6 +101,9 @@ public abstract class LocalSession implements Session {
...
@@ -101,6 +101,9 @@ public abstract class LocalSession implements Session {
* @param streamID unique identifier for this session.
* @param streamID unique identifier for this session.
*/
*/
public
LocalSession
(
String
serverName
,
Connection
connection
,
StreamID
streamID
)
{
public
LocalSession
(
String
serverName
,
Connection
connection
,
StreamID
streamID
)
{
if
(
connection
==
null
)
{
throw
new
IllegalArgumentException
(
"connection must not be null"
);
}
conn
=
connection
;
conn
=
connection
;
this
.
streamID
=
streamID
;
this
.
streamID
=
streamID
;
this
.
serverName
=
serverName
;
this
.
serverName
=
serverName
;
...
@@ -328,10 +331,8 @@ public abstract class LocalSession implements Session {
...
@@ -328,10 +331,8 @@ public abstract class LocalSession implements Session {
abstract
void
deliver
(
Packet
packet
)
throws
UnauthorizedException
;
abstract
void
deliver
(
Packet
packet
)
throws
UnauthorizedException
;
public
void
deliverRawText
(
String
text
)
{
public
void
deliverRawText
(
String
text
)
{
if
(
conn
!=
null
)
{
conn
.
deliverRawText
(
text
);
conn
.
deliverRawText
(
text
);
}
}
}
/**
/**
* Returns a text with the available stream features. Each subclass may return different
* Returns a text with the available stream features. Each subclass may return different
...
@@ -342,10 +343,8 @@ public abstract class LocalSession implements Session {
...
@@ -342,10 +343,8 @@ public abstract class LocalSession implements Session {
public
abstract
String
getAvailableStreamFeatures
();
public
abstract
String
getAvailableStreamFeatures
();
public
void
close
()
{
public
void
close
()
{
if
(
conn
!=
null
)
{
conn
.
close
();
conn
.
close
();
}
}
}
public
boolean
validate
()
{
public
boolean
validate
()
{
return
conn
.
validate
();
return
conn
.
validate
();
...
...
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