glenn       2003/10/22 06:46:28

  Modified:    util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  SocketExceptions can occur in a networked app.
  No need to log a stack trace, just log the remote host
  name/ip and the exception message. Then there is less
  cruft in the logs.
  
  Revision  Changes    Path
  1.25      +11 -3     
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- PoolTcpEndpoint.java      12 Oct 2003 21:15:53 -0000      1.24
  +++ PoolTcpEndpoint.java      22 Oct 2003 13:46:28 -0000      1.25
  @@ -587,6 +587,14 @@
                    con.setSocket(s);
                    endpoint.setSocketOptions( s );
                    endpoint.getConnectionHandler().processConnection(con, perThrData);
  +                } catch (SocketException se) {
  +                    endpoint.log.error(
  +                       "Remote Host " + s.getInetAddress() +
  +                       " SocketException: " + se.getMessage());
  +                    // Try to close the socket
  +                    try {
  +                        s.close();
  +                    } catch (IOException e) {}
                   } catch (Throwable t) {
                       endpoint.log.error("Unexpected error", t);
                       // Try to close the socket
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to