# HG changeset patch # User Matthew Wild # Date 1341769784 -3600 # Node ID 521976cb56e63b3c8048149f50f3ee7a6349fab4 # Parent 2c1de519f639567beba869151de156f62816a29b# Parent 06635b834e76f767ac6bdbb84213696afc28c297 Merge 0.9->trunk diff -r 06635b834e76 -r 521976cb56e6 plugins/mod_auth_anonymous.lua --- a/plugins/mod_auth_anonymous.lua Sat Jul 07 02:43:57 2012 +0100 +++ b/plugins/mod_auth_anonymous.lua Sun Jul 08 18:49:44 2012 +0100 @@ -32,10 +32,9 @@ return nil, "Account creation/modification not supported."; end - function provider.get_sasl_handler(session) + function provider.get_sasl_handler() local anonymous_authentication_profile = { anonymous = function(sasl, username, realm) - session.roster = {}; -- so that the null storage backend doesn't upset rostermanager return true; -- for normal usage you should always return true here end }; diff -r 06635b834e76 -r 521976cb56e6 util-src/pposix.c --- a/util-src/pposix.c Sat Jul 07 02:43:57 2012 +0100 +++ b/util-src/pposix.c Sun Jul 08 18:49:44 2012 +0100 @@ -34,6 +34,11 @@ #include "lua.h" #include "lauxlib.h" +#if (defined(_SVID_SOURCE) && !defined(WITHOUT_MALLINFO)) + #include + #define WITH_MALLINFO +#endif + /* Daemonization support */ static int lc_daemonize(lua_State *L) @@ -612,6 +617,25 @@ return 1; } +#ifdef WITH_MALLINFO +int lc_meminfo(lua_State* L) +{ + struct mallinfo info = mallinfo(); + lua_newtable(L); + lua_pushinteger(L, info.arena); + lua_setfield(L, -2, "allocated"); + lua_pushinteger(L, info.hblkhd); + lua_setfield(L, -2, "allocated_mmap"); + lua_pushinteger(L, info.uordblks); + lua_setfield(L, -2, "used"); + lua_pushinteger(L, info.fordblks); + lua_setfield(L, -2, "unused"); + lua_pushinteger(L, info.keepcost); + lua_setfield(L, -2, "returnable"); + return 1; +} +#endif + /* Register functions */ int luaopen_util_pposix(lua_State *L) @@ -645,6 +669,10 @@ { "setenv", lc_setenv }, +#ifdef WITH_MALLINFO + { "meminfo", lc_meminfo }, +#endif + { NULL, NULL } };