diff options
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -5,10 +5,6 @@ #include <string.h> #include <unistd.h> -#include <lua.h> - -#include "stream.h" - int buffer_grow(struct buffer * b) { int allocated = b->allocated + 1024; @@ -57,7 +53,7 @@ int buffer_read_more(int fd, struct buffer * in, int minimum_length) return length; } -int buffer_prepare_at_least(lua_State * L, int fd, struct buffer * in, int minimum_length, lua_KContext ctx) +int buffer_prepare_at_least(int fd, struct buffer * in, int minimum_length) { const int remaining_bytes = in->length - in->next; @@ -65,15 +61,7 @@ int buffer_prepare_at_least(lua_State * L, int fd, struct buffer * in, int minim { const int res = buffer_read_more(fd, in, minimum_length); if (-1 == res) - { - if (EWOULDBLOCK == errno || EAGAIN == errno) - return lua_yieldk(L, 0, ctx, stream_readk); - else - { - lua_pushstring(L, strerror(errno)); - return lua_error(L); - } - } + return res; } return remaining_bytes; |