]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: applet: rename applet_runq to applet_active_queue
authorWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2015 15:39:23 +0000 (17:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2015 16:02:44 +0000 (18:02 +0200)
This is not a real run queue and we're facing ugly bugs because
if this : if a an applet removes another applet from the queue,
typically the next one after itself, the list iterator loops
forever because the list's backup pointer is not valid anymore.
Before creating a run queue, let's rename this list.

include/proto/applet.h
src/applet.c
src/haproxy.c

index 3e68b0085edb47492779f45fe8aad345e8f2f912..b256816b55119629e7b3575906282f12a8d83420 100644 (file)
@@ -29,7 +29,7 @@
 #include <types/applet.h>
 #include <proto/connection.h>
 
-extern struct list applet_runq;
+extern struct list applet_active_queue;
 
 void applet_run_active();
 
@@ -75,7 +75,7 @@ static inline void appctx_free(struct appctx *appctx)
 static inline void appctx_wakeup(struct appctx *appctx)
 {
        if (LIST_ISEMPTY(&appctx->runq))
-               LIST_ADDQ(&applet_runq, &appctx->runq);
+               LIST_ADDQ(&applet_active_queue, &appctx->runq);
 }
 
 /* removes an applet from the list of active applets */
index 481000a80b4296896ab9239580e9e83fb994b3bf..cc467c49d7525a22697f9a47b094a72de4020d92 100644 (file)
 #include <proto/stream.h>
 #include <proto/stream_interface.h>
 
-struct list applet_runq = LIST_HEAD_INIT(applet_runq);
+struct list applet_active_queue = LIST_HEAD_INIT(applet_active_queue);
 
 void applet_run_active()
 {
        struct appctx *curr, *back;
        struct stream_interface *si;
 
-       list_for_each_entry_safe(curr, back, &applet_runq, runq) {
+       list_for_each_entry_safe(curr, back, &applet_active_queue, runq) {
                si = curr->owner;
 
                /* now we'll need a buffer */
index 465bb6a15a91eb65428938c508ba30dd480f094b..a20f4977be89bef0d75b9ca93791f27762faa446 100644 (file)
@@ -1524,7 +1524,7 @@ void run_poll_loop()
                        break;
 
                /* expire immediately if events are pending */
-               if (fd_cache_num || run_queue || signal_queue_len || !LIST_ISEMPTY(&applet_runq))
+               if (fd_cache_num || run_queue || signal_queue_len || !LIST_ISEMPTY(&applet_active_queue))
                        next = now_ms;
 
                /* The poller will ensure it returns around <next> */