Index: trunk/src/sh_forward.c
===================================================================
--- trunk/src/sh_forward.c	(revision 218)
+++ trunk/src/sh_forward.c	(revision 219)
@@ -842,4 +842,23 @@
   SL_RETURN(i, _("sh_forward_req_file")); 
 }
+
+static unsigned long sh_throttle_delay = 0;
+
+int sh_forward_set_throttle_delay (const char * c)
+{
+  long val;
+
+  SL_ENTER(_("sh_forward_set_throttle_delay"));
+
+  val = strtol (c, (char **)NULL, 10);
+  if (val < 0)
+    SL_RETURN( (-1), _("sh_forward_set_throttle_delay"));
+
+  val = (val > 1000) ? 1000 : val;
+
+  sh_throttle_delay = (unsigned long) val;
+  SL_RETURN( (0), _("sh_forward_set_throttle_delay"));
+}
+
 
 static  long sh_forward_try_impl (char * errmsg, char what)
@@ -1682,4 +1701,12 @@
 					flag_err-KEY_LEN);
 			++transfercount;
+			/***
+			 ***  --- Delay for throughput throttling ---
+			 ***/
+			if (sh_throttle_delay > 0)
+			  retry_msleep(sh_throttle_delay/1000, sh_throttle_delay % 1000);
+			/***
+			 ***  --- End delay                       ---
+			 ***/
 			flag_err = 
 			  sh_forward_send_crypt (sockfd, (char) theProto, 
@@ -4792,6 +4819,31 @@
 }
 
+#define  TIME_OUT_DEF 900
+static   unsigned long  time_out_val = TIME_OUT_DEF;
+
+int sh_forward_set_timeout (const char * c)
+{
+  long val;
+
+  SL_ENTER(_("sh_forward_set_time_out"));
+
+  val = strtol (c, (char **)NULL, 10);
+
+  if (val == 0)
+    {
+      val = TIME_OUT_DEF;
+    }
+  else if (val < 0)
+    {
+      time_out_val = TIME_OUT_DEF;
+      SL_RETURN( (-1), _("sh_forward_set_time_out"));
+    }
+
+  time_out_val = (unsigned long) val;
+  SL_RETURN( (0), _("sh_forward_set_time_out"));
+}
+
+
 static   sh_conn_t        * conns = NULL;
-#define  TIME_OUT_DEF 900
 static   int  maxconn = 0;  /* maximum number of simultaneous connections */
 
@@ -4906,5 +4958,5 @@
   unsigned long      time_now;
   unsigned long      time_last = 0;
-  unsigned long      time_out = TIME_OUT_DEF;  
+  unsigned long      time_out = time_out_val;  
   
   time_t told;
@@ -5198,9 +5250,12 @@
       /* -- Exponentially reduce timeout limit if more than 1/2 full. --
        */
+      /* Eliminate this, will cause problems when too much clients are
+       * starting up. */
+#if 0
       if (nowconn > (maxconn/2))
 	time_out = ( (time_out/2) > 1) ? (time_out/2) : 1;
       else
-	time_out = TIME_OUT_DEF;
-      
+	time_out = time_out_val;
+#endif
       
       
Index: trunk/src/sh_readconf.c
===================================================================
--- trunk/src/sh_readconf.c	(revision 218)
+++ trunk/src/sh_readconf.c	(revision 219)
@@ -1056,4 +1056,6 @@
   { N_("setclienttimelimit"),  SH_SECTION_SRV,  SH_SECTION_MISC, 
     sh_forward_set_time_limit },
+  { N_("setconnectiontimeout"),SH_SECTION_SRV,  SH_SECTION_MISC, 
+    sh_forward_set_timeout },
   { N_("useclientseverity"),   SH_SECTION_SRV,  SH_SECTION_MISC, 
   sh_forward_use_clt_sev },
@@ -1083,4 +1085,6 @@
   { N_("setlogserver"),        SH_SECTION_CLT,  SH_SECTION_MISC, 
     sh_forward_setlogserver },
+  { N_("setthrottle"),         SH_SECTION_CLT,  SH_SECTION_MISC, 
+    sh_forward_set_throttle_delay},
 #endif
 #endif
