mirror of
https://github.com/brunoos/luasec.git
synced 2025-07-19 15:29:46 +02:00
- using buffer from luasocket 3.0.
- adding getstats() and setstats().
This commit is contained in:
18
src/ssl.c
18
src/ssl.c
@ -286,6 +286,22 @@ static int meth_receive(lua_State *L) {
|
||||
return buffer_meth_receive(L, &ssl->buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the buffer's statistics.
|
||||
*/
|
||||
static int meth_getstats(lua_State *L) {
|
||||
p_ssl ssl = (p_ssl)luaL_checkudata(L, 1, "SSL:Connection");
|
||||
return buffer_meth_getstats(L, &ssl->buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the buffer's statistics.
|
||||
*/
|
||||
static int meth_setstats(lua_State *L) {
|
||||
p_ssl ssl = (p_ssl)luaL_checkudata(L, 1, "SSL:Connection");
|
||||
return buffer_meth_setstats(L, &ssl->buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Select support methods
|
||||
*/
|
||||
@ -655,6 +671,8 @@ static luaL_Reg methods[] = {
|
||||
{"getpeerchain", meth_getpeerchain},
|
||||
{"getpeerverification", meth_getpeerverification},
|
||||
{"getpeerfinished", meth_getpeerfinished},
|
||||
{"getstats", meth_getstats},
|
||||
{"setstats", meth_setstats},
|
||||
{"dirty", meth_dirty},
|
||||
{"dohandshake", meth_handshake},
|
||||
{"receive", meth_receive},
|
||||
|
Reference in New Issue
Block a user