aboutsummaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorCaleb Maclennan <caleb@alerque.com>2023-11-10 09:12:04 +0300
committerCaleb Maclennan <caleb@alerque.com>2023-11-10 09:12:04 +0300
commit5c4fc93d5f4137bf4c22ddf1a048c907a4a26727 (patch)
treea9a68e1f6a9c3bfe2b64fa1c3a4098865b7d3b5d /src/buffer.c
parentccef3bc4e2aa6ee5b997a80aabb58f4ff0b0e98f (diff)
parent43a97b7f0053313b43906371dbdc226271e6c8ab (diff)
downloadluasocket-hjelmeland-patch-1.tar.gz
luasocket-hjelmeland-patch-1.tar.bz2
luasocket-hjelmeland-patch-1.zip
Merge branch 'master' into hjelmeland-patch-1hjelmeland-patch-1
Diffstat (limited to '')
-rw-r--r--src/buffer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c
index fff1634..7148be3 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2,10 +2,7 @@
2* Input/Output interface for Lua programs 2* Input/Output interface for Lua programs
3* LuaSocket toolkit 3* LuaSocket toolkit
4\*=========================================================================*/ 4\*=========================================================================*/
5#include "lua.h" 5#include "luasocket.h"
6#include "lauxlib.h"
7#include "compat.h"
8
9#include "buffer.h" 6#include "buffer.h"
10 7
11/*=========================================================================*\ 8/*=========================================================================*\
@@ -106,11 +103,14 @@ int buffer_meth_send(lua_State *L, p_buffer buf) {
106* object:receive() interface 103* object:receive() interface
107\*-------------------------------------------------------------------------*/ 104\*-------------------------------------------------------------------------*/
108int buffer_meth_receive(lua_State *L, p_buffer buf) { 105int buffer_meth_receive(lua_State *L, p_buffer buf) {
109 int err = IO_DONE, top = lua_gettop(L); 106 int err = IO_DONE, top;
110 luaL_Buffer b; 107 luaL_Buffer b;
111 size_t size; 108 size_t size;
112 const char *part = luaL_optlstring(L, 3, "", &size); 109 const char *part = luaL_optlstring(L, 3, "", &size);
113 timeout_markstart(buf->tm); 110 timeout_markstart(buf->tm);
111 /* make sure we don't confuse buffer stuff with arguments */
112 lua_settop(L, 3);
113 top = lua_gettop(L);
114 /* initialize buffer with optional extra prefix 114 /* initialize buffer with optional extra prefix
115 * (useful for concatenating previous partial results) */ 115 * (useful for concatenating previous partial results) */
116 luaL_buffinit(L, &b); 116 luaL_buffinit(L, &b);