ustream-fd: handle ENOTCONN for read/write on not-yet-connected sockets Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream-fd: handle uloop errors The default uloop error handling is to delete the fd. Continue to do that, but also set the write_error flag and notify the user. Signed-off-by: Philip Craig <philipjcraig@gmail.com>
ustream-fd: stop trying to read when s->read_blocked is set. User's s->notify_read is called in ustream_fill_read(). If s->read_blocked is set there, then stop reading more. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
ustream-fd: readability change. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
ustream-fd: fix logic invert of write polling. ustream_write_pending() returns true if write buffer was flushed there. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
ustream: only report stream eof once via state_change callback Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream-fd: do not loop back into the callback from ustream_fd_set_uloop Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream: set the right EOF flag Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream-fd: only use read() == 0 as eof indication, and issue a state change notification when that happens Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream-fd: retry partial writes Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream-fd: prevent callbacks during init Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream-fd: fix read error handling Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream: avoid calling s->poll from a write path to avoid looping back through the notify_write cb Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream: fix polling for write buffer availability after buffering writes Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream: add a poll callback function defined by the ustream implementation
add ustream, an api for stream buffer management