diff --git a/src/flb_io.c b/src/flb_io.c index 1e0872f5f2b..c1ff0bfcc35 100644 --- a/src/flb_io.c +++ b/src/flb_io.c @@ -316,15 +316,10 @@ static FLB_INLINE int net_io_write_async(struct flb_coro *co, static ssize_t fd_io_read(int fd, void *buf, size_t len); static ssize_t net_io_read(struct flb_upstream_conn *u_conn, void *buf, size_t len) -{ - return fd_io_read(u_conn->fd, buf, len); -} - -static ssize_t fd_io_read(int fd, void *buf, size_t len) { int ret; - ret = recv(fd, buf, len, 0); + ret = fd_io_read(u_conn->fd, buf, len); if (ret == -1) { ret = FLB_WOULDBLOCK(); if (ret) { @@ -340,6 +335,18 @@ static ssize_t fd_io_read(int fd, void *buf, size_t len) return ret; } +static ssize_t fd_io_read(int fd, void *buf, size_t len) +{ + int ret; + + ret = recv(fd, buf, len, 0); + if (ret == -1) { + return -1; + } + + return ret; +} + static FLB_INLINE ssize_t net_io_read_async(struct flb_coro *co, struct flb_upstream_conn *u_conn, void *buf, size_t len)