james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vince...@apache.org
Subject svn commit: r157735 - james/server/branches/branch_2_1_fcs/src/java/org/apache/james/transport/mailets/ClamAVScan.java
Date Wed, 16 Mar 2005 11:21:13 GMT
Author: vincenzo
Date: Wed Mar 16 03:21:11 2005
New Revision: 157735

URL: http://svn.apache.org/viewcvs?view=rev&rev=157735
Log:
Backported to java 1.3.x (and because of that removed "connectionTimeoutMilli" support.

Modified:
    james/server/branches/branch_2_1_fcs/src/java/org/apache/james/transport/mailets/ClamAVScan.java

Modified: james/server/branches/branch_2_1_fcs/src/java/org/apache/james/transport/mailets/ClamAVScan.java
URL: http://svn.apache.org/viewcvs/james/server/branches/branch_2_1_fcs/src/java/org/apache/james/transport/mailets/ClamAVScan.java?view=diff&r1=157734&r2=157735
==============================================================================
--- james/server/branches/branch_2_1_fcs/src/java/org/apache/james/transport/mailets/ClamAVScan.java
(original)
+++ james/server/branches/branch_2_1_fcs/src/java/org/apache/james/transport/mailets/ClamAVScan.java
Wed Mar 16 03:21:11 2005
@@ -62,9 +62,6 @@
  *        The default is <I>30000</I> (30 seconds).</LI>
  *    <LI><CODE>&lt;streamBufferSize&gt;</CODE>: the BufferedOutputStream
buffer size to use 
  *        writing to the <I>stream connection</I>. The default is <I>8192</I>.</LI>
- *    <LI><CODE>&lt;connectionTimeoutMilli&gt;</CODE>: the connection
timeout (in milliseconds)
- *        when making the main connections (<I>not</I> for the initialization
pings).
- *        The default is <I>20000</I> (20 seconds).</LI>
  * </UL>
  * 
  * <P>The actions performed are as follows:</P>
@@ -226,11 +223,6 @@
     private int nextAddressIndex;
 
     /**
-     * Holds value of property connectionTimeoutMilli.
-     */
-    private int connectionTimeoutMilli;
-
-    /**
      * Return a string describing this mailet.
      *
      * @return a string describing this mailet
@@ -248,8 +240,7 @@
                     "port",
                     "maxPings",
                     "pingIntervalMilli",
-                    "streamBufferSize",
-                    "connectionTimeoutMilli"
+                    "streamBufferSize"
         };
         return allowedArray;
     }
@@ -432,35 +423,6 @@
     }
     
     /**
-     * Initializer for property connectionTimeoutMilli.
-     */
-    protected void initConnectionTimeoutMilli() {
-        String connectionTimeoutMilliParam = getInitParameter("connectionTimeoutMilli");
-        setConnectionTimeoutMilli((connectionTimeoutMilliParam == null) ? DEFAULT_CONNECTION_TIMEOUT
: Integer.parseInt(connectionTimeoutMilliParam));
-        if (isDebug()) {
-            log("connectionTimeoutMilli: " + getConnectionTimeoutMilli());
-        }
-    }
-
-    /**
-     * Getter for property connectionTimeoutMilli.
-     * @return Value of property connectionTimeoutMilli.
-     */
-    public int getConnectionTimeoutMilli() {
-
-        return this.connectionTimeoutMilli;
-    }
-
-    /**
-     * Setter for property connectionTimeoutMilli.
-     * @param connectionTimeoutMilli New value of property connectionTimeoutMilli.
-     */
-    public void setConnectionTimeoutMilli(int connectionTimeoutMilli) {
-
-        this.connectionTimeoutMilli = connectionTimeoutMilli;
-    }
-
-    /**
      * Indexed getter for property addresses.
      * @param index Index of the property.
      * @return Value of the property at <CODE>index</CODE>.
@@ -527,8 +489,6 @@
         
         InetAddress address = null;
         
-        Socket socket = new Socket();
-        
         Set usedAddresses = new HashSet(getAddressesCount());
         for (;;) {
             // this do-while loop is needed because other threads could in the meantime
@@ -544,10 +504,7 @@
             } while (!usedAddresses.add(address));
             try {
                 // get the socket
-//                return new Socket(address, getPort());
-                SocketAddress socketAddress = new InetSocketAddress(address, getPort());
-                socket.connect(socketAddress, getConnectionTimeoutMilli());
-                return socket;
+                return new Socket(address, getPort());
             } catch (IOException ioe) {
                 log("Exception caught acquiring main socket to CLAMD on "
                         + address + " on port " + getPort() + ": " + ioe.getMessage());
@@ -577,7 +534,6 @@
             initMaxPings();
             initPingIntervalMilli();
             initStreamBufferSize();
-            initConnectionTimeoutMilli();
             
             // If "maxPings is > ping the CLAMD server to check if it is up
             if (getMaxPings() > 0) {



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


Mime
View raw message