tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r660175 - in /tomcat/connectors/trunk/jni: CHANGELOG.txt native/src/poll.c
Date Mon, 26 May 2008 12:42:14 GMT
Author: mturk
Date: Mon May 26 05:42:11 2008
New Revision: 660175

URL: http://svn.apache.org/viewvc?rev=660175&view=rev
Log:
Fix 45071 by updating ttl for signaled but not removed sockets

Modified:
    tomcat/connectors/trunk/jni/CHANGELOG.txt
    tomcat/connectors/trunk/jni/native/src/poll.c

Modified: tomcat/connectors/trunk/jni/CHANGELOG.txt
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jni/CHANGELOG.txt?rev=660175&r1=660174&r2=660175&view=diff
==============================================================================
--- tomcat/connectors/trunk/jni/CHANGELOG.txt (original)
+++ tomcat/connectors/trunk/jni/CHANGELOG.txt Mon May 26 05:42:11 2008
@@ -19,7 +19,7 @@
 ./jnirelease.sh
 TO BUILD THE TEXT VERSION.
 
-
+Fix: BZ45071 by reseting ttl when Poll.pool remove is false(mturk)
 Fix: IFS problem in native/build/tcnative.m4 (rjung)
 Fix: Wrong gcc link flag in native/build/tcnative.m4 (rjung)
 Tag: 1_1.12

Modified: tomcat/connectors/trunk/jni/native/src/poll.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jni/native/src/poll.c?rev=660175&r1=660174&r2=660175&view=diff
==============================================================================
--- tomcat/connectors/trunk/jni/native/src/poll.c (original)
+++ tomcat/connectors/trunk/jni/native/src/poll.c Mon May 26 05:42:11 2008
@@ -224,6 +224,20 @@
     return apr_pollset_remove(p->pollset, fd);
 }
 
+static void update_ttl(tcn_pollset_t *p, const apr_pollfd_t *fd, apr_time_t t)
+{
+    apr_int32_t i;
+
+    for (i = 0; i < p->nelts; i++) {
+        if (fd->desc.s == p->socket_set[i].desc.s) {
+            /* Found an instance of the fd: update ttl */
+            p->socket_ttl[i] = t;
+            break;
+        }
+    }
+}
+
+
 static void remove_all(tcn_pollset_t *p)
 {
     apr_int32_t i;
@@ -266,6 +280,7 @@
     tcn_pollset_t *p = J2P(pollset,  tcn_pollset_t *);
     apr_int32_t  i, num = 0;
     apr_status_t rv = APR_SUCCESS;
+    apr_time_t now;
     apr_interval_time_t ptime = J2T(timeout);
     UNREFERENCED(o);
     TCN_ASSERT(pollset != 0);
@@ -275,7 +290,7 @@
 #endif
 
     if (ptime > 0 && p->max_ttl >= 0) {
-        apr_time_t now = apr_time_now();
+        now = apr_time_now();
 
         /* Find the minimum timeout */
         for (i = 0; i < p->nelts; i++) {
@@ -316,11 +331,15 @@
          p->sp_polled += num;
          p->sp_max_polled = TCN_MAX(p->sp_max_polled, num);
 #endif
+        if (!remove)
+            now = apr_time_now();
         for (i = 0; i < num; i++) {
             p->set[i*2+0] = (jlong)(fd->rtnevents);
             p->set[i*2+1] = P2J(fd->client_data);
             if (remove)
                 do_remove(p, fd);
+            else
+                update_ttl(p, fd, now);
             fd ++;
         }
         (*e)->SetLongArrayRegion(e, set, 0, num * 2, p->set);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message