httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccre...@apache.org
Subject svn commit: r156700 - httpd/httpd/branches/1.3.x/src/os/tpf/os.c
Date Wed, 09 Mar 2005 22:50:17 GMT
Author: mccreedy
Date: Wed Mar  9 14:50:14 2005
New Revision: 156700

URL: http://svn.apache.org/viewcvs?view=rev&rev=156700
Log:
Changed tpf/os.c's tpf_select function to bump the passed select timeout value by 1 second.
This is needed because TPF's select waits between timeout-1 and timeout seconds.
Also renamed 'timeout' variable to clarify when it is used for seconds vs. milliseconds.

Modified:
    httpd/httpd/branches/1.3.x/src/os/tpf/os.c

Modified: httpd/httpd/branches/1.3.x/src/os/tpf/os.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/1.3.x/src/os/tpf/os.c?view=diff&r1=156699&r2=156700
==============================================================================
--- httpd/httpd/branches/1.3.x/src/os/tpf/os.c (original)
+++ httpd/httpd/branches/1.3.x/src/os/tpf/os.c Wed Mar  9 14:50:14 2005
@@ -55,12 +55,13 @@
     int no_reads = 0;
     int no_writes = 0;
     int no_excepts = 0;
-    int timeout = 0;
+    int timeout_seconds = 0;
+    int timeout_millisec = 0;
     int rv = 0;
     
     if(maxfds) {
         if(tv)
-            timeout = tv->tv_sec * 1000 + tv->tv_usec;
+            timeout_millisec = tv->tv_sec * 1000 + tv->tv_usec;
         sockets[0] = maxfds-1;
         no_reads++;
     }
@@ -78,24 +79,28 @@
 #ifdef TPF_HAVE_SAWNC
         struct ev0bk evnblock;
 #endif
-        timeout = tv->tv_sec;
+        /* event processing uses seconds, select uses milliseconds */
+        timeout_seconds = tv->tv_sec;
         if (tv->tv_usec) {
-            timeout++; /* round up to seconds (like TPF's select does) */
+            timeout_seconds++;  /* round up to seconds (like TPF's select does) */
         }
-        if (timeout > 0) { /* paranoid check for valid timeout */
+        if (timeout_seconds > 0) { /* paranoid check for valid timeout */
 #ifdef TPF_HAVE_SAWNC
             evnblock.evnpstinf.evnbkc1 = 1; /* nbr of posts needed */
-            evntc(&evnblock, EVENT_CNT, 'N', timeout, EVNTC_1052);
+            evntc(&evnblock, EVENT_CNT, 'N', timeout_seconds, EVNTC_1052);
             tpf_sawnc(&evnblock, EVENT_CNT);
 #else
-            sleep(timeout);
+            sleep(timeout_seconds);
 #endif
         }
     } else {
-        if (timeout < 0) { /* paranoid check for valid timeout */
-            timeout = 0;
+        if (timeout_millisec < 0) { /* paranoid check for valid timeout */
+            timeout_millisec = 0;
         }
-        rv = select(sockets, no_reads, no_writes, no_excepts, timeout);
+        if (timeout_millisec != 0)
+            timeout_millisec += 1000;
+ 
+        rv = select(sockets, no_reads, no_writes, no_excepts, timeout_millisec);
     }
     ap_check_signals();
     



Mime
View raw message