MINOR: stream-int/conn-stream: Move si_cs_io_cb() in the conn-stream scope
si_cs_io_cb() is renamed cs_conn_io_cb(). In addition, the context of the
tasklet used to wake-up the conn-stream is now a conn-stream.
diff --git a/src/conn_stream.c b/src/conn_stream.c
index 352624d..7f72e1c 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -227,8 +227,8 @@
cs->wait_event.tasklet = tasklet_new();
if (!cs->wait_event.tasklet)
return -1;
- cs->wait_event.tasklet->process = si_cs_io_cb;
- cs->wait_event.tasklet->context = cs->si;
+ cs->wait_event.tasklet->process = cs_conn_io_cb;
+ cs->wait_event.tasklet->context = cs;
cs->wait_event.events = 0;
}
@@ -273,8 +273,8 @@
cs->si = NULL;
return -1;
}
- cs->wait_event.tasklet->process = si_cs_io_cb;
- cs->wait_event.tasklet->context = cs->si;
+ cs->wait_event.tasklet->process = cs_conn_io_cb;
+ cs->wait_event.tasklet->context = cs;
cs->wait_event.events = 0;
cs->ops = &cs_app_conn_ops;
diff --git a/src/debug.c b/src/debug.c
index 6f482d2..1e83c11 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -252,8 +252,8 @@
s = (struct stream *)task->context;
else if (task->process == task_run_applet && task->context)
s = cs_strm(((struct appctx *)task->context)->owner);
- else if (task->process == si_cs_io_cb && task->context)
- s = cs_strm(((struct stream_interface *)task->context)->cs);
+ else if (task->process == cs_conn_io_cb && task->context)
+ s = cs_strm(((struct conn_stream *)task->context));
if (s)
stream_dump(buf, s, pfx, '\n');
diff --git a/src/stream_interface.c b/src/stream_interface.c
index ed0f7ca..4260565 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -459,23 +459,22 @@
* 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 int state)
+struct task *cs_conn_io_cb(struct task *t, void *ctx, unsigned int state)
{
- struct stream_interface *si = ctx;
- struct conn_stream *cs = si->cs;
+ struct conn_stream *cs = ctx;
int ret = 0;
if (!cs_conn(cs))
return t;
- if (!(cs->wait_event.events & SUB_RETRY_SEND) && !channel_is_empty(si_oc(si)))
+ if (!(cs->wait_event.events & SUB_RETRY_SEND) && !channel_is_empty(cs_oc(cs)))
ret = si_cs_send(cs);
if (!(cs->wait_event.events & SUB_RETRY_RECV))
ret |= si_cs_recv(cs);
if (ret != 0)
si_cs_process(cs);
- stream_release_buffers(si_strm(si));
+ stream_release_buffers(__cs_strm(cs));
return t;
}
diff --git a/src/tools.c b/src/tools.c
index 5d5e1b0..f62ba9a 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -4917,7 +4917,7 @@
} fcts[] = {
{ .func = process_stream, .name = "process_stream" },
{ .func = task_run_applet, .name = "task_run_applet" },
- { .func = si_cs_io_cb, .name = "si_cs_io_cb" },
+ { .func = cs_conn_io_cb, .name = "cs_conn_io_cb" },
{ .func = sock_conn_iocb, .name = "sock_conn_iocb" },
{ .func = dgram_fd_handler, .name = "dgram_fd_handler" },
{ .func = listener_accept, .name = "listener_accept" },