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/stream_interface.c b/src/stream_interface.c
index 024c2f5..1d67c31 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -721,7 +721,7 @@
if (oc->flags & CF_STREAMER)
send_flag |= CO_SFL_STREAMER;
- ret = conn->mux->snd_buf(cs, &oc->buf, co_data(oc), send_flag);
+ ret = cs_send(cs, &oc->buf, co_data(oc), send_flag);
if (ret > 0) {
did_send = 1;
oc->flags |= CF_WRITE_PARTIAL | CF_WROTE_DATA | CF_WRITE_EVENT;