MEDIUM: task: extend the state field to 32 bits

It's been too short for quite a while now and is now full. It's still
time to extend it to 32-bits since we have room for this without
wasting any space, so we now gained 16 new bits for future flags.

The values were not reassigned just in case there would be a few
hidden u16 or short somewhere in which these flags are placed (as
it used to be the case with stream->pending_events).

The patch is tagged MEDIUM because this required to update the task's
process() prototype to use an int instead of a short, that's quite a
bunch of places.
diff --git a/src/applet.c b/src/applet.c
index a806eca..eafce3d 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -58,7 +58,7 @@
 }
 
 /* Default applet handler */
-struct task *task_run_applet(struct task *t, void *context, unsigned short state)
+struct task *task_run_applet(struct task *t, void *context, unsigned int state)
 {
 	struct appctx *app = context;
 	struct stream_interface *si = app->owner;
diff --git a/src/check.c b/src/check.c
index ba9c1f3..2642d58 100644
--- a/src/check.c
+++ b/src/check.c
@@ -834,7 +834,7 @@
 }
 
 /* This function checks if any I/O is wanted, and if so, attempts to do so */
-struct task *event_srv_chk_io(struct task *t, void *ctx, unsigned short state)
+struct task *event_srv_chk_io(struct task *t, void *ctx, unsigned int state)
 {
 	struct check *check = ctx;
 	struct conn_stream *cs = check->cs;
@@ -849,7 +849,7 @@
  * Please do NOT place any return statement in this function and only leave
  * via the out_unlock label.
  */
-struct task *process_chk_conn(struct task *t, void *context, unsigned short state)
+struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
 {
 	struct check *check = context;
 	struct proxy *proxy = check->proxy;
@@ -1071,7 +1071,7 @@
 /* manages a server health-check. Returns the time the task accepts to wait, or
  * TIME_ETERNITY for infinity.
  */
-struct task *process_chk(struct task *t, void *context, unsigned short state)
+struct task *process_chk(struct task *t, void *context, unsigned int state)
 {
 	struct check *check = context;
 
@@ -1120,7 +1120,7 @@
  * reached, the task automatically stops. Note that any server status change
  * must have updated s->last_change accordingly.
  */
-struct task *server_warmup(struct task *t, void *context, unsigned short state)
+struct task *server_warmup(struct task *t, void *context, unsigned int state)
 {
 	struct server *s = context;
 
diff --git a/src/debug.c b/src/debug.c
index 914c80d..f86d054 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -729,7 +729,7 @@
 	return 1;
 }
 
-static struct task *debug_task_handler(struct task *t, void *ctx, unsigned short state)
+static struct task *debug_task_handler(struct task *t, void *ctx, unsigned int state)
 {
 	unsigned long *tctx = ctx; // [0] = #tasks, [1] = inter, [2+] = { tl | (tsk+1) }
 	unsigned long inter = tctx[1];
@@ -752,7 +752,7 @@
 	return t;
 }
 
-static struct task *debug_tasklet_handler(struct task *t, void *ctx, unsigned short state)
+static struct task *debug_tasklet_handler(struct task *t, void *ctx, unsigned int state)
 {
 	unsigned long *tctx = ctx; // [0] = #tasks, [1] = inter, [2+] = { tl | (tsk+1) }
 	unsigned long rnd;
diff --git a/src/dns.c b/src/dns.c
index 6e39d6b..56a1945 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -925,7 +925,7 @@
 /* Task processing expiration of unresponded queries, this one is supposed
  * to be stuck on the same thread than the appctx handler
  */
-static struct task *dns_process_query_exp(struct task *t, void *context, unsigned short state)
+static struct task *dns_process_query_exp(struct task *t, void *context, unsigned int state)
 {
 	struct dns_session *ds = (struct dns_session *)context;
 	struct dns_query *query, *queryb;
@@ -949,7 +949,7 @@
 }
 
 /* Task processing expiration of idle sessions */
-static struct task *dns_process_idle_exp(struct task *t, void *context, unsigned short state)
+static struct task *dns_process_idle_exp(struct task *t, void *context, unsigned int state)
 {
 	struct dns_stream_server *dss = (struct dns_stream_server *)context;
 	struct dns_session *ds, *dsb;
@@ -1059,7 +1059,7 @@
  * and forward them to dns_session ring.
  * Note: If no slot found a new dns_session is allocated
  */
-static struct task *dns_process_req(struct task *t, void *context, unsigned short state)
+static struct task *dns_process_req(struct task *t, void *context, unsigned int state)
 {
 	struct dns_nameserver *ns = (struct dns_nameserver *)context;
 	struct dns_stream_server *dss = ns->stream;
@@ -1193,7 +1193,7 @@
  * Task used to consume response
  * Note: upper layer callback is called
  */
-static struct task *dns_process_rsp(struct task *t, void *context, unsigned short state)
+static struct task *dns_process_rsp(struct task *t, void *context, unsigned int state)
 {
 	struct dns_nameserver *ns = (struct dns_nameserver *)context;
 
diff --git a/src/extcheck.c b/src/extcheck.c
index 4634731..6eaeac1 100644
--- a/src/extcheck.c
+++ b/src/extcheck.c
@@ -475,7 +475,7 @@
  * Please do NOT place any return statement in this function and only leave
  * via the out_unlock label.
  */
-struct task *process_chk_proc(struct task *t, void *context, unsigned short state)
+struct task *process_chk_proc(struct task *t, void *context, unsigned int state)
 {
 	struct check *check = context;
 	struct server *s = check->server;
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index 089f248..81b951a 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -1196,7 +1196,7 @@
 /* Callback function that catches applet timeouts. If a timeout occurred, we set
  * <appctx->st1> flag and the SPOE applet is woken up. */
 static struct task *
-spoe_process_appctx(struct task * task, void *context, unsigned short state)
+spoe_process_appctx(struct task * task, void *context, unsigned int state)
 {
 	struct appctx *appctx = context;
 
diff --git a/src/hlua.c b/src/hlua.c
index 67c75fc..857e885 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -6298,7 +6298,7 @@
  * Task wrapper are longjmp safe because the only one Lua code
  * executed is the safe hlua_ctx_resume();
  */
-struct task *hlua_process_task(struct task *task, void *context, unsigned short state)
+struct task *hlua_process_task(struct task *task, void *context, unsigned int state)
 {
 	struct hlua *hlua = context;
 	enum hlua_exec status;
@@ -7042,7 +7042,7 @@
 	return act_ret;
 }
 
-struct task *hlua_applet_wakeup(struct task *t, void *context, unsigned short state)
+struct task *hlua_applet_wakeup(struct task *t, void *context, unsigned int state)
 {
 	struct appctx *ctx = context;
 
diff --git a/src/listener.c b/src/listener.c
index 400a7eb..8a8ad73 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -120,7 +120,7 @@
 /* proceed with accepting new connections. Don't mark it static so that it appears
  * in task dumps.
  */
-struct task *accept_queue_process(struct task *t, void *context, unsigned short state)
+struct task *accept_queue_process(struct task *t, void *context, unsigned int state)
 {
 	struct accept_queue_ring *ring = context;
 	struct connection *conn;
@@ -1170,7 +1170,7 @@
  * a while. It is designed to be called as a task. It's exported so that it's easy
  * to spot in "show tasks" or "show profiling".
  */
-struct task *manage_global_listener_queue(struct task *t, void *context, unsigned short state)
+struct task *manage_global_listener_queue(struct task *t, void *context, unsigned int state)
 {
 	/* If there are still too many concurrent connections, let's wait for
 	 * some of them to go away. We don't need to re-arm the timer because
diff --git a/src/mailers.c b/src/mailers.c
index 291064d..b65bfeb 100644
--- a/src/mailers.c
+++ b/src/mailers.c
@@ -55,7 +55,7 @@
 	pool_free(pool_head_email_alert, alert);
 }
 
-static struct task *process_email_alert(struct task *t, void *context, unsigned short state)
+static struct task *process_email_alert(struct task *t, void *context, unsigned int state)
 {
 	struct check        *check = context;
 	struct email_alertq *q;
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index fabc83e..d5302a0 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -353,12 +353,12 @@
 DECLARE_STATIC_POOL(pool_head_fcgi_conn, "fcgi_conn", sizeof(struct fcgi_conn));
 DECLARE_STATIC_POOL(pool_head_fcgi_strm, "fcgi_strm", sizeof(struct fcgi_strm));
 
-struct task *fcgi_timeout_task(struct task *t, void *context, unsigned short state);
+struct task *fcgi_timeout_task(struct task *t, void *context, unsigned int state);
 static int fcgi_process(struct fcgi_conn *fconn);
 /* fcgi_io_cb is exported to see it resolved in "show fd" */
-struct task *fcgi_io_cb(struct task *t, void *ctx, unsigned short state);
+struct task *fcgi_io_cb(struct task *t, void *ctx, unsigned int state);
 static inline struct fcgi_strm *fcgi_conn_st_by_id(struct fcgi_conn *fconn, int id);
-struct task *fcgi_deferred_shut(struct task *t, void *ctx, unsigned short state);
+struct task *fcgi_deferred_shut(struct task *t, void *ctx, unsigned int state);
 static struct fcgi_strm *fcgi_conn_stream_new(struct fcgi_conn *fconn, struct conn_stream *cs, struct session *sess);
 static void fcgi_strm_notify_recv(struct fcgi_strm *fstrm);
 static void fcgi_strm_notify_send(struct fcgi_strm *fstrm);
@@ -2975,7 +2975,7 @@
 }
 
 /* this is the tasklet referenced in fconn->wait_event.tasklet */
-struct task *fcgi_io_cb(struct task *t, void *ctx, unsigned short status)
+struct task *fcgi_io_cb(struct task *t, void *ctx, unsigned int status)
 {
 	struct connection *conn;
 	struct fcgi_conn *fconn;
@@ -3147,7 +3147,7 @@
  * immediately killed. If it's allocatable and empty, we attempt to send a
  * ABORT records.
  */
-struct task *fcgi_timeout_task(struct task *t, void *context, unsigned short state)
+struct task *fcgi_timeout_task(struct task *t, void *context, unsigned int state)
 {
 	struct fcgi_conn *fconn = context;
 	int expired = tick_is_expired(t->expire, now_ms);
@@ -3758,7 +3758,7 @@
  * deferred shutdowns when the fcgi_detach() was done but the mux buffer was full
  * and prevented the last record from being emitted.
  */
-struct task *fcgi_deferred_shut(struct task *t, void *ctx, unsigned short state)
+struct task *fcgi_deferred_shut(struct task *t, void *ctx, unsigned int state)
 {
 	struct fcgi_strm *fstrm = ctx;
 	struct fcgi_conn *fconn = fstrm->fconn;
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 215153c..d5b9e99 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -266,8 +266,8 @@
 static int h1_send(struct h1c *h1c);
 static int h1_process(struct h1c *h1c);
 /* h1_io_cb is exported to see it resolved in "show fd" */
-struct task *h1_io_cb(struct task *t, void *ctx, unsigned short state);
-struct task *h1_timeout_task(struct task *t, void *context, unsigned short state);
+struct task *h1_io_cb(struct task *t, void *ctx, unsigned int state);
+struct task *h1_timeout_task(struct task *t, void *context, unsigned int state);
 static void h1_shutw_conn(struct connection *conn, enum cs_shw_mode mode);
 static void h1_wake_stream_for_recv(struct h1s *h1s);
 static void h1_wake_stream_for_send(struct h1s *h1s);
@@ -2799,7 +2799,7 @@
 	return -1;
 }
 
-struct task *h1_io_cb(struct task *t, void *ctx, unsigned short status)
+struct task *h1_io_cb(struct task *t, void *ctx, unsigned int status)
 {
 	struct connection *conn;
 	struct tasklet *tl = (struct tasklet *)t;
@@ -2882,7 +2882,7 @@
 /* Connection timeout management. The principle is that if there's no receipt
  * nor sending for a certain amount of time, the connection is closed.
  */
-struct task *h1_timeout_task(struct task *t, void *context, unsigned short state)
+struct task *h1_timeout_task(struct task *t, void *context, unsigned int state)
 {
 	struct h1c *h1c = context;
 	int expired = tick_is_expired(t->expire, now_ms);
diff --git a/src/mux_h2.c b/src/mux_h2.c
index b406c8a..4fcd2d6 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -551,16 +551,16 @@
 	.id        = 0,
 };
 
-struct task *h2_timeout_task(struct task *t, void *context, unsigned short state);
+struct task *h2_timeout_task(struct task *t, void *context, unsigned int state);
 static int h2_send(struct h2c *h2c);
 static int h2_recv(struct h2c *h2c);
 static int h2_process(struct h2c *h2c);
 /* h2_io_cb is exported to see it resolved in "show fd" */
-struct task *h2_io_cb(struct task *t, void *ctx, unsigned short state);
+struct task *h2_io_cb(struct task *t, void *ctx, unsigned int state);
 static inline struct h2s *h2c_st_by_id(struct h2c *h2c, int id);
 static int h2c_decode_headers(struct h2c *h2c, struct buffer *rxbuf, uint32_t *flags, unsigned long long *body_len, char *upgrade_protocol);
 static int h2_frt_transfer_data(struct h2s *h2s);
-struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned short state);
+struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned int state);
 static struct h2s *h2c_bck_stream_new(struct h2c *h2c, struct conn_stream *cs, struct session *sess);
 static void h2s_alert(struct h2s *h2s);
 
@@ -3773,7 +3773,7 @@
 }
 
 /* this is the tasklet referenced in h2c->wait_event.tasklet */
-struct task *h2_io_cb(struct task *t, void *ctx, unsigned short status)
+struct task *h2_io_cb(struct task *t, void *ctx, unsigned int status)
 {
 	struct connection *conn;
 	struct tasklet *tl = (struct tasklet *)t;
@@ -3963,7 +3963,7 @@
  * immediately killed. If it's allocatable and empty, we attempt to send a
  * GOAWAY frame.
  */
-struct task *h2_timeout_task(struct task *t, void *context, unsigned short state)
+struct task *h2_timeout_task(struct task *t, void *context, unsigned int state)
 {
 	struct h2c *h2c = context;
 	int expired = tick_is_expired(t->expire, now_ms);
@@ -4431,7 +4431,7 @@
  * deferred shutdowns when the h2_detach() was done but the mux buffer was full
  * and prevented the last frame from being emitted.
  */
-struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned short state)
+struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned int state)
 {
 	struct h2s *h2s = ctx;
 	struct h2c *h2c = h2s->h2c;
diff --git a/src/mux_pt.c b/src/mux_pt.c
index 4191ee6..9d73d46 100644
--- a/src/mux_pt.c
+++ b/src/mux_pt.c
@@ -56,7 +56,7 @@
 /* Callback, used when we get I/Os while in idle mode. This one is exported so
  * that "show fd" can resolve it.
  */
-struct task *mux_pt_io_cb(struct task *t, void *tctx, unsigned short status)
+struct task *mux_pt_io_cb(struct task *t, void *tctx, unsigned int status)
 {
 	struct mux_pt_ctx *ctx = tctx;
 
diff --git a/src/peers.c b/src/peers.c
index 3780e67..1aa2646 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -2873,7 +2873,7 @@
  * tasks wakeup on local update and heartbeat. Let's keep it exported so that it
  * resolves in stack traces and "show tasks".
  */
-struct task *process_peer_sync(struct task * task, void *context, unsigned short state)
+struct task *process_peer_sync(struct task * task, void *context, unsigned int state)
 {
 	struct peers *peers = context;
 	struct peer *ps;
diff --git a/src/proxy.c b/src/proxy.c
index 745d6ee..6d783fd 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -1506,7 +1506,7 @@
  * called as a task which is woken up upon stopping or when rate limiting must
  * be enforced.
  */
-struct task *manage_proxy(struct task *t, void *context, unsigned short state)
+struct task *manage_proxy(struct task *t, void *context, unsigned int state)
 {
 	struct proxy *p = context;
 	int next = TICK_ETERNITY;
@@ -1604,7 +1604,7 @@
 	return 0;
 }
 
-struct task *hard_stop(struct task *t, void *context, unsigned short state)
+struct task *hard_stop(struct task *t, void *context, unsigned int state)
 {
 	struct proxy *p;
 	struct stream *s;
diff --git a/src/resolvers.c b/src/resolvers.c
index 55acd9c..7dcb8f8 100644
--- a/src/resolvers.c
+++ b/src/resolvers.c
@@ -2005,7 +2005,7 @@
  * resolutions and retry them if possible. Else a timeout is reported. Then, it
  * checks the wait list to trigger new resolutions.
  */
-static struct task *process_resolvers(struct task *t, void *context, unsigned short state)
+static struct task *process_resolvers(struct task *t, void *context, unsigned int state)
 {
 	struct resolvers  *resolvers = context;
 	struct resolv_resolution *res, *resback;
diff --git a/src/server.c b/src/server.c
index d570e67..db54d3f 100644
--- a/src/server.c
+++ b/src/server.c
@@ -4561,7 +4561,7 @@
 	*s->adm_st_chg_cause = 0;
 }
 
-struct task *srv_cleanup_toremove_conns(struct task *task, void *context, unsigned short state)
+struct task *srv_cleanup_toremove_conns(struct task *task, void *context, unsigned int state)
 {
 	struct connection *conn;
 
@@ -4629,7 +4629,7 @@
 	}
 }
 
-struct task *srv_cleanup_idle_conns(struct task *task, void *context, unsigned short state)
+struct task *srv_cleanup_idle_conns(struct task *task, void *context, unsigned int state)
 {
 	struct server *srv;
 	struct eb32_node *eb;
diff --git a/src/session.c b/src/session.c
index 34bd0a3..daf3995 100644
--- a/src/session.c
+++ b/src/session.c
@@ -324,7 +324,7 @@
  * disabled and finally kills the file descriptor. This function requires that
  * sess->origin points to the incoming connection.
  */
-static void session_kill_embryonic(struct session *sess, unsigned short state)
+static void session_kill_embryonic(struct session *sess, unsigned int state)
 {
 	int level = LOG_INFO;
 	struct connection *conn = __objt_conn(sess->origin);
@@ -378,7 +378,7 @@
  * strikes and performs the required cleanup. It's only exported to make it
  * resolve in "show tasks".
  */
-struct task *session_expire_embryonic(struct task *t, void *context, unsigned short state)
+struct task *session_expire_embryonic(struct task *t, void *context, unsigned int state)
 {
 	struct session *sess = context;
 
diff --git a/src/sink.c b/src/sink.c
index 0bd259c..88dbe90 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -693,7 +693,7 @@
 /*
  * Task to handle connctions to forward servers
  */
-static struct task *process_sink_forward(struct task * task, void *context, unsigned short state)
+static struct task *process_sink_forward(struct task * task, void *context, unsigned int state)
 {
 	struct sink *sink = (struct sink *)context;
 	struct sink_forward_target *sft = sink->sft;
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index d3a3a03..bc25d02 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -183,7 +183,7 @@
 INITCALL1(STG_REGISTER, stats_register_module, &ssl_stats_module);
 
 /* ssl_sock_io_cb is exported to see it resolved in "show fd" */
-struct task *ssl_sock_io_cb(struct task *, void *, unsigned short);
+struct task *ssl_sock_io_cb(struct task *, void *, unsigned int);
 static int ssl_sock_handshake(struct connection *conn, unsigned int flag);
 
 /* Methods to implement OpenSSL BIO */
@@ -5797,7 +5797,7 @@
 	return (ctx->xprt->remove_xprt(conn, ctx->xprt_ctx, toremove_ctx, newops, newctx));
 }
 
-struct task *ssl_sock_io_cb(struct task *t, void *context, unsigned short state)
+struct task *ssl_sock_io_cb(struct task *t, void *context, unsigned int state)
 {
 	struct tasklet *tl = (struct tasklet *)t;
 	struct ssl_sock_ctx *ctx = context;
diff --git a/src/stick_table.c b/src/stick_table.c
index 1692fe2..e305a44 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -626,7 +626,7 @@
  * Task processing function to trash expired sticky sessions. A pointer to the
  * task itself is returned since it never dies.
  */
-struct task *process_table_expire(struct task *task, void *context, unsigned short state)
+struct task *process_table_expire(struct task *task, void *context, unsigned int state)
 {
 	struct stktable *t = context;
 
diff --git a/src/stream.c b/src/stream.c
index e3e0847..e96d89e 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1525,7 +1525,7 @@
  * and each function is called only if at least another function has changed at
  * least one flag it is interested in.
  */
-struct task *process_stream(struct task *t, void *context, unsigned short state)
+struct task *process_stream(struct task *t, void *context, unsigned int state)
 {
 	struct server *srv;
 	struct stream *s = context;
diff --git a/src/stream_interface.c b/src/stream_interface.c
index 59d2852..0d316a2 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -767,7 +767,7 @@
  * stream interface. Thus it is always safe to perform a tasklet_wakeup() on a
  * stream interface, as the presence of the CS is checked there.
  */
-struct task *si_cs_io_cb(struct task *t, void *ctx, unsigned short state)
+struct task *si_cs_io_cb(struct task *t, void *ctx, unsigned int state)
 {
 	struct stream_interface *si = ctx;
 	struct conn_stream *cs = objt_cs(si->end);
diff --git a/src/task.c b/src/task.c
index 350146d..a99d30a 100644
--- a/src/task.c
+++ b/src/task.c
@@ -64,7 +64,7 @@
  */
 void task_kill(struct task *t)
 {
-	unsigned short state = t->state;
+	unsigned int state = t->state;
 	unsigned int thr;
 
 	BUG_ON(state & TASK_KILLED);
@@ -433,14 +433,14 @@
  */
 unsigned int run_tasks_from_lists(unsigned int budgets[])
 {
-	struct task *(*process)(struct task *t, void *ctx, unsigned short state);
+	struct task *(*process)(struct task *t, void *ctx, unsigned int state);
 	struct list *tl_queues = sched->tasklets;
 	struct task *t;
 	uint8_t budget_mask = (1 << TL_CLASSES) - 1;
 	struct sched_activity *profile_entry = NULL;
 	unsigned int done = 0;
 	unsigned int queue;
-	unsigned short state;
+	unsigned int state;
 	void *ctx;
 
 	for (queue = 0; queue < TL_CLASSES;) {
@@ -806,7 +806,7 @@
  * is returned on success, otherwise NULL on failure.
  */
 struct work_list *work_list_create(int nbthread,
-                                   struct task *(*fct)(struct task *, void *, unsigned short),
+                                   struct task *(*fct)(struct task *, void *, unsigned int),
                                    void *arg)
 {
 	struct work_list *wl;
diff --git a/src/xprt_handshake.c b/src/xprt_handshake.c
index 15e2a8f..3d03f1c 100644
--- a/src/xprt_handshake.c
+++ b/src/xprt_handshake.c
@@ -37,7 +37,7 @@
 }
 
 /* xprt_handshake_io_cb is exported to see it resolved in "show fd" */
-struct task *xprt_handshake_io_cb(struct task *t, void *bctx, unsigned short state)
+struct task *xprt_handshake_io_cb(struct task *t, void *bctx, unsigned int state)
 {
 	struct xprt_handshake_ctx *ctx = bctx;
 	struct connection *conn = ctx->conn;
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index 57c910f..4efcb2a 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -2462,7 +2462,7 @@
 }
 
 /* Callback called upon loss detection and PTO timer expirations. */
-static struct task *process_timer(struct task *task, void *ctx, unsigned short state)
+static struct task *process_timer(struct task *task, void *ctx, unsigned int state)
 {
 	struct quic_conn_ctx *conn_ctx;
 	struct quic_conn *qc;
@@ -3848,7 +3848,7 @@
 }
 
 /* QUIC connection packet handler task. */
-struct task *quic_conn_io_cb(struct task *t, void *context, unsigned short state)
+struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state)
 {
 	struct quic_conn_ctx *ctx = context;