aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer_event.c')
-rw-r--r--src/buffer_event.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/buffer_event.c b/src/buffer_event.c
index 70b726c..598230f 100644
--- a/src/buffer_event.c
+++ b/src/buffer_event.c
@@ -153,8 +153,7 @@ static int buffer_event_set_read_watermarks(lua_State* L) {
low = lua_tonumber(L, 2);
high = lua_tonumber(L, 3);
- ev->ev->wm_read.low = low;
- ev->ev->wm_read.high = high;
+ bufferevent_setwatermark(ev->ev, EV_READ, low, high);
return 0;
}
@@ -166,29 +165,10 @@ static int buffer_event_set_write_watermarks(lua_State* L) {
low = lua_tonumber(L, 2);
high = lua_tonumber(L, 3);
- ev->ev->wm_write.low = low;
- ev->ev->wm_write.high = high;
+ bufferevent_setwatermark(ev->ev, EV_WRITE, low, high);
return 0;
}
-static int buffer_event_get_read_watermarks(lua_State* L) {
- le_bufferevent* ev = buffer_event_get(L, 1);
- if(!ev->ev) return 0;
-
- lua_pushinteger(L, ev->ev->wm_read.low);
- lua_pushinteger(L, ev->ev->wm_read.high);
- return 2;
-}
-
-static int buffer_event_get_write_watermarks(lua_State* L) {
- le_bufferevent* ev = buffer_event_get(L, 1);
- if(!ev->ev) return 0;
-
- lua_pushinteger(L, ev->ev->wm_write.low);
- lua_pushinteger(L, ev->ev->wm_write.high);
- return 2;
-}
-
static int buffer_event_set_timeouts(lua_State* L) {
int timeout_read, timeout_write;
le_bufferevent* ev = buffer_event_get(L, 1);
@@ -201,15 +181,6 @@ static int buffer_event_set_timeouts(lua_State* L) {
return 0;
}
-static int buffer_event_get_timeouts(lua_State* L) {
- le_bufferevent* ev = buffer_event_get(L, 1);
- if(!ev->ev) return 0;
-
- lua_pushinteger(L, ev->ev->timeout_read);
- lua_pushinteger(L, ev->ev->timeout_write);
- return 2;
-}
-
static int buffer_event_enable(lua_State* L) {
le_bufferevent* ev = buffer_event_get(L, 1);
if(!ev->ev) return 0;
@@ -231,10 +202,7 @@ static luaL_Reg buffer_event_funcs[] = {
{"get_write", buffer_event_get_write},
{"set_read_watermarks", buffer_event_set_read_watermarks},
{"set_write_watermarks", buffer_event_set_write_watermarks},
- {"get_read_watermarks", buffer_event_get_read_watermarks},
- {"get_write_watermarks", buffer_event_get_write_watermarks},
{"set_timeouts", buffer_event_set_timeouts},
- {"get_timeouts", buffer_event_get_timeouts},
{"enable", buffer_event_enable},
{"disable", buffer_event_disable},
{NULL, NULL}