noel 2003/01/26 19:35:40
Modified: src/java/org/apache/james/nntpserver NNTPHandler.java
Log:
Fixed the regression caused by the previous change. The socket will be null (and
closed) if the connection has idled out.
Revision Changes Path
1.32 +10 -6
jakarta-james/src/java/org/apache/james/nntpserver/NNTPHandler.java
Index: NNTPHandler.java
===================================================================
RCS file:
/home/cvs/jakarta-james/src/java/org/apache/james/nntpserver/NNTPHandler.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- NNTPHandler.java 18 Jan 2003 19:01:45 -0000 1.31
+++ NNTPHandler.java 27 Jan 2003 03:35:40 -0000 1.32
@@ -353,13 +353,17 @@
getLogger().info("Connection closed");
} catch (Exception e) {
- // unexpected error. try to send quit msg.
- // this may fail if socket has been closed by peer.
- try {
- doQUIT(null);
- } catch(Throwable t) { }
+ // if the connection has been idled out, the
+ // socket will be closed and null. Do NOT
+ // log the exception or attempt to send the
+ // closing connection message
+ if (socket != null) {
+ try {
+ doQUIT(null);
+ } catch(Throwable t) { }
- getLogger().error( "Exception during connection:" + e.getMessage(), e );
+ getLogger().error( "Exception during connection:" + e.getMessage(),
e );
+ }
} finally {
resetHandler();
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>