- Timestamp:
- Feb 24, 2009, 8:02:21 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/Changelog
r218 r219 1 1 2.5.3: 2 * Option SetThrottle to throttle throughput for db download 3 * Option SetConnectionTimeout to configure the client connection 4 timeout configurable 2 5 * Provide getrpcbynumber, getservbyname implementations 3 6 to avoid dependencies with static linkage -
trunk/include/sh_forward.h
r170 r219 30 30 int sh_forward_create_password (const char * dummy); 31 31 32 /* set time limit 32 /* set timeout for active client connections 33 */ 34 int sh_forward_set_timeout (const char * c); 35 36 /* set time limit after which client is reported dead 33 37 */ 34 38 int sh_forward_set_time_limit(const char * str); … … 108 112 #ifdef SH_WITH_CLIENT 109 113 114 /* Throttle file download 115 */ 116 int sh_forward_set_throttle_delay (const char * c); 117 110 118 /* request file from server. file may be "CONF" or "DATA". 111 119 */ -
trunk/src/sh_forward.c
r215 r219 842 842 SL_RETURN(i, _("sh_forward_req_file")); 843 843 } 844 845 static unsigned long sh_throttle_delay = 0; 846 847 int sh_forward_set_throttle_delay (const char * c) 848 { 849 long val; 850 851 SL_ENTER(_("sh_forward_set_throttle_delay")); 852 853 val = strtol (c, (char **)NULL, 10); 854 if (val < 0) 855 SL_RETURN( (-1), _("sh_forward_set_throttle_delay")); 856 857 val = (val > 1000) ? 1000 : val; 858 859 sh_throttle_delay = (unsigned long) val; 860 SL_RETURN( (0), _("sh_forward_set_throttle_delay")); 861 } 862 844 863 845 864 static long sh_forward_try_impl (char * errmsg, char what) … … 1682 1701 flag_err-KEY_LEN); 1683 1702 ++transfercount; 1703 /*** 1704 *** --- Delay for throughput throttling --- 1705 ***/ 1706 if (sh_throttle_delay > 0) 1707 retry_msleep(sh_throttle_delay/1000, sh_throttle_delay % 1000); 1708 /*** 1709 *** --- End delay --- 1710 ***/ 1684 1711 flag_err = 1685 1712 sh_forward_send_crypt (sockfd, (char) theProto, … … 4792 4819 } 4793 4820 4821 #define TIME_OUT_DEF 900 4822 static unsigned long time_out_val = TIME_OUT_DEF; 4823 4824 int sh_forward_set_timeout (const char * c) 4825 { 4826 long val; 4827 4828 SL_ENTER(_("sh_forward_set_time_out")); 4829 4830 val = strtol (c, (char **)NULL, 10); 4831 4832 if (val == 0) 4833 { 4834 val = TIME_OUT_DEF; 4835 } 4836 else if (val < 0) 4837 { 4838 time_out_val = TIME_OUT_DEF; 4839 SL_RETURN( (-1), _("sh_forward_set_time_out")); 4840 } 4841 4842 time_out_val = (unsigned long) val; 4843 SL_RETURN( (0), _("sh_forward_set_time_out")); 4844 } 4845 4846 4794 4847 static sh_conn_t * conns = NULL; 4795 #define TIME_OUT_DEF 9004796 4848 static int maxconn = 0; /* maximum number of simultaneous connections */ 4797 4849 … … 4906 4958 unsigned long time_now; 4907 4959 unsigned long time_last = 0; 4908 unsigned long time_out = TIME_OUT_DEF;4960 unsigned long time_out = time_out_val; 4909 4961 4910 4962 time_t told; … … 5198 5250 /* -- Exponentially reduce timeout limit if more than 1/2 full. -- 5199 5251 */ 5252 /* Eliminate this, will cause problems when too much clients are 5253 * starting up. */ 5254 #if 0 5200 5255 if (nowconn > (maxconn/2)) 5201 5256 time_out = ( (time_out/2) > 1) ? (time_out/2) : 1; 5202 5257 else 5203 time_out = TIME_OUT_DEF;5204 5258 time_out = time_out_val; 5259 #endif 5205 5260 5206 5261 -
trunk/src/sh_readconf.c
r216 r219 1056 1056 { N_("setclienttimelimit"), SH_SECTION_SRV, SH_SECTION_MISC, 1057 1057 sh_forward_set_time_limit }, 1058 { N_("setconnectiontimeout"),SH_SECTION_SRV, SH_SECTION_MISC, 1059 sh_forward_set_timeout }, 1058 1060 { N_("useclientseverity"), SH_SECTION_SRV, SH_SECTION_MISC, 1059 1061 sh_forward_use_clt_sev }, … … 1083 1085 { N_("setlogserver"), SH_SECTION_CLT, SH_SECTION_MISC, 1084 1086 sh_forward_setlogserver }, 1087 { N_("setthrottle"), SH_SECTION_CLT, SH_SECTION_MISC, 1088 sh_forward_set_throttle_delay}, 1085 1089 #endif 1086 1090 #endif
Note:
See TracChangeset
for help on using the changeset viewer.