noel 2003/01/26 19:30:08
Modified: src/java/org/apache/james/nntpserver Tag: branch_2_1_fcs
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
No revision
No revision
1.25.4.4 +10 -9
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.25.4.3
retrieving revision 1.25.4.4
diff -u -r1.25.4.3 -r1.25.4.4
--- NNTPHandler.java 18 Jan 2003 20:07:53 -0000 1.25.4.3
+++ NNTPHandler.java 27 Jan 2003 03:30:08 -0000 1.25.4.4
@@ -49,9 +49,6 @@
*
* Common NNTP extensions are in RFC 2980.
*
- * @author Fedor Karpelevitch
- * @author Harmeet <[EMAIL PROTECTED]>
- * @author Peter M. Goldstein <[EMAIL PROTECTED]>
*/
public class NNTPHandler
extends AbstractLogEnabled
@@ -361,13 +358,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]>