httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1666468 - in /httpd/httpd/trunk: CHANGES server/mpm/event/event.c
Date Fri, 13 Mar 2015 14:47:50 GMT
Author: ylavic
Date: Fri Mar 13 14:47:50 2015
New Revision: 1666468

URL: http://svn.apache.org/r1666468
Log:
mpm_event: Allow for timer events duplicates. 
Meanwhile ap[r]_skiplist_add()...

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/mpm/event/event.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1666468&r1=1666467&r2=1666468&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Mar 13 14:47:50 2015
@@ -6,6 +6,8 @@ Changes with Apache 2.5.0
      to a local URL-path with the INCLUDES filter active, introduced
      in 2.4.11. PR 57531. [Yann Ylavic]
 
+  *) mpm_event: Allow for timer events duplicates. [Jim Jagielski, Yann Ylavic]
+
   *) mod_dav: Avoid a potential integer underflow in the lock timeout value sent
      back to a client. The answer to a LOCK request could be an extremly large
      integer if the time needed to lock the resource was longer that the

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1666468&r1=1666467&r2=1666468&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Fri Mar 13 14:47:50 2015
@@ -1460,7 +1460,7 @@ static int indexing_comp(void *a, void *
     apr_time_t t2 = (apr_time_t) (((timer_event_t *) b)->when);
     AP_DEBUG_ASSERT(t1);
     AP_DEBUG_ASSERT(t2);
-    return ((t1 < t2) ? -1 : ((t1 > t2) ? 1 : 0));
+    return ((t1 < t2) ? -1 : (t1 > t2));
 }
 
 static int indexing_compk(void *ac, void *b)
@@ -1468,7 +1468,16 @@ static int indexing_compk(void *ac, void
     apr_time_t *t1 = (apr_time_t *) ac;
     apr_time_t t2 = (apr_time_t) (((timer_event_t *) b)->when);
     AP_DEBUG_ASSERT(t2);
-    return ((*t1 < t2) ? -1 : ((*t1 > t2) ? 1 : 0));
+    return ((*t1 < t2) ? -1 : (*t1 > t2));
+}
+
+static int indexing_add_comp(void *a, void *b)
+{
+    apr_time_t t1 = (apr_time_t) (((timer_event_t *) a)->when);
+    apr_time_t t2 = (apr_time_t) (((timer_event_t *) b)->when);
+    AP_DEBUG_ASSERT(t1);
+    AP_DEBUG_ASSERT(t2);
+    return ((t1 < t2) ? -1 : 1);
 }
 
 static apr_thread_mutex_t *g_timer_skiplist_mtx;
@@ -1500,8 +1509,8 @@ static timer_event_t * event_get_timer_e
     te->remove = remove;
 
     if (insert) { 
-        /* Okay, insert sorted by when.. */
-        apr_skiplist_insert(timer_skiplist, (void *)te);
+        /* Okay, add sorted by when.. */
+        apr_skiplist_insert_compare(timer_skiplist, te, indexing_add_comp);
     }
     apr_thread_mutex_unlock(g_timer_skiplist_mtx);
 



Mime
View raw message