diff options
author | Liam Devine <dmail00@gmail.com> | 2011-07-07 01:14:16 +0100 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2012-04-11 13:33:34 -0700 |
commit | e81a6ff6232a93a903c1f71a111ee469376b1e05 (patch) | |
tree | 5a29fc86c6336da34b59b99633aa09e4f5914e68 | |
parent | 9a582525289b98eae15c37ee43f0eb1cd3c925b9 (diff) | |
download | luasocket-e81a6ff6232a93a903c1f71a111ee469376b1e05.tar.gz luasocket-e81a6ff6232a93a903c1f71a111ee469376b1e05.tar.bz2 luasocket-e81a6ff6232a93a903c1f71a111ee469376b1e05.zip |
Conditional creation of p_timeout instance 'tm'
-rw-r--r-- | src/buffer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c index 8d90598..452a579 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
@@ -80,7 +80,9 @@ int buffer_meth_send(lua_State *L, p_buffer buf) { | |||
80 | const char *data = luaL_checklstring(L, 2, &size); | 80 | const char *data = luaL_checklstring(L, 2, &size); |
81 | long start = (long) luaL_optnumber(L, 3, 1); | 81 | long start = (long) luaL_optnumber(L, 3, 1); |
82 | long end = (long) luaL_optnumber(L, 4, -1); | 82 | long end = (long) luaL_optnumber(L, 4, -1); |
83 | #ifdef LUASOCKET_DEBUG | ||
83 | p_timeout tm = timeout_markstart(buf->tm); | 84 | p_timeout tm = timeout_markstart(buf->tm); |
85 | #endif | ||
84 | if (start < 0) start = (long) (size+start+1); | 86 | if (start < 0) start = (long) (size+start+1); |
85 | if (end < 0) end = (long) (size+end+1); | 87 | if (end < 0) end = (long) (size+end+1); |
86 | if (start < 1) start = (long) 1; | 88 | if (start < 1) start = (long) 1; |
@@ -111,7 +113,9 @@ int buffer_meth_receive(lua_State *L, p_buffer buf) { | |||
111 | luaL_Buffer b; | 113 | luaL_Buffer b; |
112 | size_t size; | 114 | size_t size; |
113 | const char *part = luaL_optlstring(L, 3, "", &size); | 115 | const char *part = luaL_optlstring(L, 3, "", &size); |
116 | #ifdef LUASOCKET_DEBUG | ||
114 | p_timeout tm = timeout_markstart(buf->tm); | 117 | p_timeout tm = timeout_markstart(buf->tm); |
118 | #endif | ||
115 | /* initialize buffer with optional extra prefix | 119 | /* initialize buffer with optional extra prefix |
116 | * (useful for concatenating previous partial results) */ | 120 | * (useful for concatenating previous partial results) */ |
117 | luaL_buffinit(L, &b); | 121 | luaL_buffinit(L, &b); |