]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: task: Move wait_event in the task header file
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Jan 2024 07:55:00 +0000 (08:55 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 7 Feb 2024 14:02:13 +0000 (15:02 +0100)
wait_event structure was in connection header file because it is only used
by connections and muxes. But, this may change. For instance applets may be
good candidates to use it too. So, the structure is moved to the task header
file instead.

include/haproxy/connection-t.h
include/haproxy/task-t.h

index 6f7f4f67d61810eac97c680ad436f41de4b2ffad..6cc62ee78888e993191a5b84392e6f762aec8e1f 100644 (file)
@@ -37,6 +37,7 @@
 #include <haproxy/port_range-t.h>
 #include <haproxy/protocol-t.h>
 #include <haproxy/show_flags-t.h>
+#include <haproxy/task-t.h>
 #include <haproxy/thread-t.h>
 
 /* referenced below */
@@ -54,14 +55,6 @@ struct bind_conf;
 struct qcs;
 struct ssl_sock_ctx;
 
-/* Note: subscribing to these events is only valid after the caller has really
- * attempted to perform the operation, and failed to proceed or complete.
- */
-enum sub_event_type {
-       SUB_RETRY_RECV       = 0x00000001,  /* Schedule the tasklet when we can attempt to recv again */
-       SUB_RETRY_SEND       = 0x00000002,  /* Schedule the tasklet when we can attempt to send again */
-};
-
 /* For each direction, we have a CO_FL_XPRT_<DIR>_ENA flag, which
  * indicates if read or write is desired in that direction for the respective
  * layers. The current status corresponding to the current layer being used is
@@ -371,16 +364,6 @@ struct socks4_request {
        char user_id[8];        /* the user ID string, variable length, terminated with a null (0x00); Using "HAProxy\0" */
 };
 
-/* Describes a set of subscriptions. Multiple events may be registered at the
- * same time. The callee should assume everything not pending for completion is
- * implicitly possible. It's illegal to change the tasklet if events are still
- * registered.
- */
-struct wait_event {
-       struct tasklet *tasklet;
-       int events;             /* set of enum sub_event_type above */
-};
-
 /* A connection handle is how we differentiate two connections on the lower
  * layers. It usually is a file descriptor but can be a connection id. The
  * CO_FL_FDLESS flag indicates which one is relevant.
index ea52de9d1bed3fefe1ba8263921de8971b311ac5..b525420f3b072da69f36fd7daa6110b2fa108fbf 100644 (file)
@@ -164,6 +164,24 @@ struct tasklet {
         */
 };
 
+/* Note: subscribing to these events is only valid after the caller has really
+ * attempted to perform the operation, and failed to proceed or complete.
+ */
+enum sub_event_type {
+       SUB_RETRY_RECV       = 0x00000001,  /* Schedule the tasklet when we can attempt to recv again */
+       SUB_RETRY_SEND       = 0x00000002,  /* Schedule the tasklet when we can attempt to send again */
+};
+
+/* Describes a set of subscriptions. Multiple events may be registered at the
+ * same time. The callee should assume everything not pending for completion is
+ * implicitly possible. It's illegal to change the tasklet if events are still
+ * registered.
+ */
+struct wait_event {
+       struct tasklet *tasklet;
+       int events;             /* set of enum sub_event_type above */
+};
+
 /*
  * The task callback (->process) is responsible for updating ->expire. It must
  * return a pointer to the task itself, except if the task has been deleted, in