logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject cvs commit: logging-log4j/src/java/org/apache/log4j/net SocketNode.java XMLSocketNode.java
Date Tue, 10 Aug 2004 06:16:56 GMT
sdeboy      2004/08/09 23:16:56

  Modified:    src/java/org/apache/log4j/net SocketNode.java
                        XMLSocketNode.java
  Log:
  Fixed typos in SocketNode log output
  Examining read length in XMLSocketNode and exiting loop if value is -1 (Thanks to Davidson
Hutton for catching this one)
  
  Revision  Changes    Path
  1.32      +3 -3      logging-log4j/src/java/org/apache/log4j/net/SocketNode.java
  
  Index: SocketNode.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/net/SocketNode.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- SocketNode.java	25 May 2004 04:45:21 -0000	1.31
  +++ SocketNode.java	10 Aug 2004 06:16:56 -0000	1.32
  @@ -161,17 +161,17 @@
             }
           }
         } catch (java.io.EOFException e) {
  -        logger.info("Caught java.io.EOFException closing conneciton.");
  +        logger.info("Caught java.io.EOFException closing connection.");
           listenerException = e;
         } catch (java.net.SocketException e) {
  -        logger.info("Caught java.net.SocketException closing conneciton.");
  +        logger.info("Caught java.net.SocketException closing connection.");
           listenerException = e;
         } catch (IOException e) {
           logger.info("Caught java.io.IOException: " + e);
           logger.info("Closing connection.");
           listenerException = e;
         } catch (Exception e) {
  -        logger.error("Unexpected exception. Closing connecition.", e);
  +        logger.error("Unexpected exception. Closing connection.", e);
           listenerException = e;
         }
       }
  
  
  
  1.6       +8 -4      logging-log4j/src/java/org/apache/log4j/net/XMLSocketNode.java
  
  Index: XMLSocketNode.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/net/XMLSocketNode.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XMLSocketNode.java	14 Apr 2004 05:38:12 -0000	1.5
  +++ XMLSocketNode.java	10 Aug 2004 06:16:56 -0000	1.6
  @@ -44,7 +44,7 @@
       @since 0.8.4
   */
   public class XMLSocketNode implements Runnable {
  -  static Logger logger = Logger.getLogger(SocketNode.class);
  +  static Logger logger = Logger.getLogger(XMLSocketNode.class);
     Socket socket;
     LoggerRepository hierarchy;
     Receiver receiver;
  @@ -134,6 +134,10 @@
               while (true) {
                   byte[] b=new byte[1024];
                   int length = is.read(b);
  +                if (length == -1) {
  +                	logger.info("no bytes read from stream - closing connection.");
  +                	break;
  +                }
                   List v= decoder.decodeEvents(new String(b, 0, length));
   
               if (v != null) {
  @@ -174,17 +178,17 @@
   
             }
         } catch (java.io.EOFException e) {
  -        logger.info("Caught java.io.EOFException closing conneciton.");
  +        logger.info("Caught java.io.EOFException closing connection.");
           listenerException = e;
         } catch (java.net.SocketException e) {
  -        logger.info("Caught java.net.SocketException closing conneciton.");
  +        logger.info("Caught java.net.SocketException closing connection.");
           listenerException = e;
         } catch (IOException e) {
           logger.info("Caught java.io.IOException: " + e);
           logger.info("Closing connection.");
           listenerException = e;
         } catch (Exception e) {
  -        logger.error("Unexpected exception. Closing connecition.", e);
  +        logger.error("Unexpected exception. Closing connection.", e);
           listenerException = e;
         }
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message