Author: rjung Date: Sun Aug 27 13:20:32 2006 New Revision: 437450 URL: http://svn.apache.org/viewvc?rev=437450&view=rev Log: Make jk_sleep_def() more useful, needed in the next step.
Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c tomcat/connectors/trunk/jk/native/common/jk_connect.h tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c tomcat/connectors/trunk/jk/native/common/jk_util.c tomcat/connectors/trunk/jk/native/common/jk_util.h Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c?rev=437450&r1=437449&r2=437450&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original) +++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Sun Aug 27 13:20:32 2006 @@ -35,25 +35,6 @@ #include "novsock2.h" #endif -/* Sleep for 100ms */ -void jk_sleep_def(void) -{ -#ifdef OS2 - DosSleep(100); -#elif defined(BEOS) - snooze(100 * 1000); -#elif defined(NETWARE) - delay(100); -#elif defined(WIN32) - Sleep(100); -#else - struct timeval tv; - tv.tv_usec = 100 * 1000; - tv.tv_sec = 0; - select(0, NULL, NULL, NULL, &tv); -#endif -} - const char *response_trans_headers[] = { "Content-Type", "Content-Language", @@ -1763,7 +1744,7 @@ "recoverable operation attempt=%d", i); /* Check for custom retries */ if (i >= JK_RETRIES) { - jk_sleep_def(); + jk_sleep(JK_SLEEP_DEF); } } else { Modified: tomcat/connectors/trunk/jk/native/common/jk_connect.h URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_connect.h?rev=437450&r1=437449&r2=437450&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_connect.h (original) +++ tomcat/connectors/trunk/jk/native/common/jk_connect.h Sun Aug 27 13:20:32 2006 @@ -55,8 +55,6 @@ int jk_is_socket_connected(jk_sock_t sd); -void jk_sleep_def(void); - #ifdef __cplusplus } #endif /* __cplusplus */ Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c?rev=437450&r1=437449&r2=437450&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original) +++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Sun Aug 27 13:20:32 2006 @@ -756,7 +756,7 @@ * on each consecutive attempt. */ if (attempt > (int)p->worker->num_of_workers) - jk_sleep_def(); + jk_sleep(JK_SLEEP_DEF); continue; } if (service_stat == JK_FALSE) { Modified: tomcat/connectors/trunk/jk/native/common/jk_util.c URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.c?rev=437450&r1=437449&r2=437450&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_util.c (original) +++ tomcat/connectors/trunk/jk/native/common/jk_util.c Sun Aug 27 13:20:32 2006 @@ -133,6 +133,25 @@ const char *jk_log_fmt = JK_TIME_FORMAT; +/* Sleep for 100ms */ +void jk_sleep(int ms) +{ +#ifdef OS2 + DosSleep(ms); +#elif defined(BEOS) + snooze(ms * 1000); +#elif defined(NETWARE) + delay(ms); +#elif defined(WIN32) + Sleep(ms); +#else + struct timeval tv; + tv.tv_usec = ms * 1000; + tv.tv_sec = 0; + select(0, NULL, NULL, NULL, &tv); +#endif +} + static int set_time_str(char *str, int len) { time_t t = time(NULL); Modified: tomcat/connectors/trunk/jk/native/common/jk_util.h URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.h?rev=437450&r1=437449&r2=437450&view=diff ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_util.h (original) +++ tomcat/connectors/trunk/jk/native/common/jk_util.h Sun Aug 27 13:20:32 2006 @@ -30,6 +30,10 @@ #include "jk_pool.h" #include "jk_service.h" +#define JK_SLEEP_DEF (100) + +void jk_sleep(int ms); + int jk_parse_log_level(const char *level); int jk_open_file_logger(jk_logger_t **l, const char *file, int level); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]