60 len = read(sf->
fd.
fd, buf, buflen);
65 if (errno == EAGAIN || errno == ENOTCONN)
93 len = write(sf->
fd.
fd, buf, buflen);
99 if (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOTCONN)
#define container_of(ptr, type, member)
struct ustream_buf * head
struct ustream_buf_list r w
int(* write)(struct ustream *s, const char *buf, int len, bool more)
void(* set_read_blocked)(struct ustream *s)
void(* free)(struct ustream *s)
bool(* poll)(struct ustream *s)
enum read_blocked_reason read_blocked
static struct epoll_event events[ULOOP_MAX_EVENTS]
int uloop_fd_add(struct uloop_fd *sock, unsigned int flags)
int uloop_fd_delete(struct uloop_fd *fd)
#define ULOOP_EDGE_TRIGGER
static void ustream_fd_set_uloop(struct ustream *s, bool write)
static int ustream_fd_write(struct ustream *s, const char *buf, int buflen, bool more)
static bool ustream_fd_poll(struct ustream *s)
static void ustream_fd_free(struct ustream *s)
static void ustream_fd_set_read_blocked(struct ustream *s)
static void ustream_fd_read_pending(struct ustream_fd *sf, bool *more)
static void ustream_uloop_cb(struct uloop_fd *fd, unsigned int events)
void ustream_fd_init(struct ustream_fd *sf, int fd)
static bool __ustream_fd_poll(struct ustream_fd *sf, unsigned int events)
void ustream_init_defaults(struct ustream *s)
bool ustream_write_pending(struct ustream *s)
void ustream_fill_read(struct ustream *s, int len)
char * ustream_reserve(struct ustream *s, int len, int *maxlen)
static void ustream_state_change(struct ustream *s)