From 0f3cac44358c94a24affd91a256c6ef08cb0d979 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Tue, 03 Aug 2010 16:19:34 +0000
Subject: [PATCH] Revert commit 6559 and complete commit 6550. There were some inconsistencies in the way the connectTimeout was applied to the tools. The time out should only apply to the establishing of the connection not to every operation done in the connection. But due to a defect, the timeout was kept for all subsequent operations preventing some of them to complete. The proposed changes reset the timeout of the socket to 0 (no timeout) once the connection has been established. Default connection timeout has been reset to 30 seconds for all tools.

---
 opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java
index 798e5c6..4614352 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java
@@ -25,7 +25,7 @@
  *      Copyright 2006-2010 Sun Microsystems, Inc.
  */
 package org.opends.server.tools;
-
+import org.opends.admin.ads.util.ConnectionUtils;
 import org.opends.messages.Message;
 
 import java.io.FileInputStream;
@@ -902,10 +902,11 @@
       version.setPropertyName(OPTION_LONG_PROTOCOL_VERSION);
       argParser.addArgument(version);
 
+      int defaultTimeout = ConnectionUtils.getDefaultLDAPTimeout();
       connectTimeout = new IntegerArgument(OPTION_LONG_CONNECT_TIMEOUT,
           null, OPTION_LONG_CONNECT_TIMEOUT,
           false, false, true, INFO_TIMEOUT_PLACEHOLDER.get(),
-          0, null,
+          defaultTimeout, null,
           true, 0, false, Integer.MAX_VALUE,
           INFO_DESCRIPTION_CONNECTION_TIMEOUT.get());
       connectTimeout.setPropertyName(OPTION_LONG_CONNECT_TIMEOUT);

--
Gitblit v1.10.0