aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Harning Jr <harningt@gmail.com>2007-11-25 18:08:11 -0500
committerThomas Harning Jr <harningt@gmail.com>2007-11-25 18:08:11 -0500
commitfead5abe2ad7d185e3a2434d5e1695193339adf5 (patch)
tree0f4876e3069621452cf491573b7c420c18d27b3c /src
parentd1943eda4282c598352916aeeb2f23c128d8fa90 (diff)
downloadluaevent-prosody-fead5abe2ad7d185e3a2434d5e1695193339adf5.tar.gz
luaevent-prosody-fead5abe2ad7d185e3a2434d5e1695193339adf5.zip
bufferevent learned get_*_watermarks
Diffstat (limited to 'src')
-rw-r--r--src/buffer_event.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/buffer_event.c b/src/buffer_event.c
index 5d74db2..e32fa04 100644
--- a/src/buffer_event.c
+++ b/src/buffer_event.c
@@ -167,11 +167,31 @@ static int buffer_event_set_write_watermarks(lua_State* L) {
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 luaL_Reg buffer_event_funcs[] = {
{"get_read", buffer_event_get_read},
{"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},
{NULL, NULL}
};