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
bc19c579
Commit
bc19c579
authored
May 26, 2015
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-883: When an exception occurs, make sure the session gets closed.
parent
bffe449a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
20 deletions
+11
-20
ConnectionHandler.java
...java/org/jivesoftware/openfire/nio/ConnectionHandler.java
+11
-20
No files found.
src/java/org/jivesoftware/openfire/nio/ConnectionHandler.java
View file @
bc19c579
...
@@ -145,30 +145,21 @@ public abstract class ConnectionHandler extends IoHandlerAdapter {
...
@@ -145,30 +145,21 @@ public abstract class ConnectionHandler extends IoHandlerAdapter {
@Override
@Override
public
void
exceptionCaught
(
IoSession
session
,
Throwable
cause
)
throws
Exception
{
public
void
exceptionCaught
(
IoSession
session
,
Throwable
cause
)
throws
Exception
{
if
(
cause
instanceof
IOException
)
{
// TODO Verify if there were packets pending to be sent and decide what to do with them
Log
.
info
(
"ConnectionHandler reports IOException for session: "
+
session
,
cause
);
if
(
cause
instanceof
SSLHandshakeException
)
{
session
.
close
(
true
);
}
}
else
if
(
cause
instanceof
ProtocolDecoderException
)
{
Log
.
warn
(
"Closing session due to exception: "
+
session
,
cause
);
Log
.
warn
(
"Closing session due to exception: "
+
session
,
cause
);
// PIO-524: Determine stream:error message.
try
{
// OF-524: Determine stream:error message.
final
StreamError
error
;
final
StreamError
error
;
if
(
cause
.
getCause
()
!=
null
&&
cause
.
getCause
()
instanceof
XMLNotWellFormedException
)
{
if
(
cause
!=
null
&&
(
cause
instanceof
XMLNotWellFormedException
||
(
cause
.
getCause
()
!=
null
&&
cause
.
getCause
()
instanceof
XMLNotWellFormedException
)
)
)
{
error
=
new
StreamError
(
StreamError
.
Condition
.
not_well_formed
);
error
=
new
StreamError
(
StreamError
.
Condition
.
not_well_formed
);
}
else
{
}
else
{
error
=
new
StreamError
(
StreamError
.
Condition
.
internal_server_error
);
error
=
new
StreamError
(
StreamError
.
Condition
.
internal_server_error
);
}
}
final
Connection
connection
=
(
Connection
)
session
.
getAttribute
(
CONNECTION
);
final
Connection
connection
=
(
Connection
)
session
.
getAttribute
(
CONNECTION
);
connection
.
deliverRawText
(
error
.
toXML
());
connection
.
deliverRawText
(
error
.
toXML
()
);
session
.
close
(
true
);
}
finally
{
}
session
.
close
(
false
);
else
{
Log
.
error
(
"ConnectionHandler reports unexpected exception for session: "
+
session
,
cause
);
}
}
}
}
...
...
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