summaryrefslogtreecommitdiffhomepage
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/buffer.c b/buffer.c
index a3f527f..ab39cb7 100644
--- a/buffer.c
+++ b/buffer.c
@@ -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;