diff --git a/lib/poller.c b/lib/poller.c index fb3843fec..250f9fcd3 100644 --- a/lib/poller.c +++ b/lib/poller.c @@ -292,30 +292,6 @@ void poller_error(struct poller *p, void *fdp) { it->blocked = 1; } -int poller_isblocked(struct poller *p, void *fdp) { - int fd = GPOINTER_TO_INT(fdp); - int ret; - - if (!p || fd < 0) - return -1; - - LOCK(&p->lock); - - ret = -1; - if (fd >= p->items->len) - goto out; - struct poller_item_int *it; - if (!(it = p->items->pdata[fd])) - goto out; - if (!it->item.writeable) - goto out; - - ret = it->blocked ? 1 : 0; - -out: - return ret; -} - void poller_loop(void *d) { struct poller *p = d; int poller_size = rtpe_common_config_ptr->poller_size; diff --git a/lib/poller.h b/lib/poller.h index ff415ffcf..a32ca06d1 100644 --- a/lib/poller.h +++ b/lib/poller.h @@ -35,7 +35,6 @@ bool poller_del_item(struct poller *, int); bool poller_del_item_callback(struct poller *, int, void (*)(void *), void *); void poller_blocked(struct poller *, void *); -int poller_isblocked(struct poller *, void *); void poller_error(struct poller *, void *); void poller_loop(void *); diff --git a/lib/streambuf.c b/lib/streambuf.c index f6fb86308..77bf0fbf7 100644 --- a/lib/streambuf.c +++ b/lib/streambuf.c @@ -209,7 +209,7 @@ void streambuf_write(struct streambuf *b, const char *s, unsigned int len) { mutex_lock(&b->lock); - while (len && !poller_isblocked(b->poller, b->fd_ptr)) { + while (len) { out = (len > 1024) ? 1024 : len; ret = b->funcs->write(b->fd_ptr, s, out);