MINOR: conn_stream: add cs_send() as a default snd_buf() function
This function is generic and is able to automatically transfer data from a
buffer to the conn_stream's tx buffer. It does this automatically if the mux
doesn't define another snd_buf() function.
It cannot yet be used as-is with the conn_stream's txbuf without risking to
lose data on close since conn_streams need to be orphaned for this.
diff --git a/src/checks.c b/src/checks.c
index 31a3939..fc9c567 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -771,7 +771,7 @@
goto out;
if (b_data(&check->bo)) {
- conn->mux->snd_buf(cs, &check->bo, b_data(&check->bo), 0);
+ cs_send(cs, &check->bo, b_data(&check->bo), 0);
b_realign_if_empty(&check->bo);
if (conn->flags & CO_FL_ERROR || cs->flags & CS_FL_ERROR) {
chk_report_conn_err(check, errno, 0);
@@ -2699,7 +2699,7 @@
int ret;
__cs_want_send(cs);
- ret = conn->mux->snd_buf(cs, &check->bo, b_data(&check->bo), 0);
+ ret = cs_send(cs, &check->bo, b_data(&check->bo), 0);
b_realign_if_empty(&check->bo);
if (ret <= 0) {