lm_connection.c
changeset 19 d775d7289fe4
parent 16 09b375e9ce32
child 23 13f03e604c8a
--- a/lm_connection.c	Sun Apr 05 16:55:48 2009 +0300
+++ b/lm_connection.c	Mon Apr 27 13:15:23 2009 +0300
@@ -229,7 +229,7 @@
 #else
 		W ("Sorry, your loudmouth have no get_keep_alive_rate ()");
 		lua_pushnil (L);
-		lua_pushstring (L, "Sorry, your loudmouth have no get_keep_alive_rate ()");
+		lua_pushliteral (L, "Sorry, your loudmouth have no get_keep_alive_rate ()");
 		return 2;
 #endif
 	}
@@ -556,9 +556,8 @@
 int luaopen_lm_connection (lua_State *L)
 {
 	luaL_newmetatable (L, "loudmouth.connection");
-	lua_pushstring (L, "__index");
-	lua_pushvalue (L, -2);
-	lua_settable (L, -3);
+	lua_pushvalue (L, -1);
+	lua_setfield (L, -2, "__index");
 	luaL_register (L, NULL, reg_m_lm_connection);
 	lua_pop (L, 1);
 	lua_newtable (L); // XXX we can specify here exact amount of fields