summaryrefslogtreecommitdiffhomepage
path: root/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'connection.c')
-rw-r--r--connection.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/connection.c b/connection.c
index 8fad3c5..d321ae0 100644
--- a/connection.c
+++ b/connection.c
@@ -8,13 +8,10 @@
#include <lua.h>
/// Creates new connection.
-/// \param L Server's Lua state
/// \param client File descriptor of client's socket
/// \return Pointer to connection or NULL if an error occured
-struct connection * connection_new(lua_State * L, const int client)
+struct connection * connection_new(const int client)
{
- (void) L; // TODO: Review if lua_State is still needed for connections and server handler.
-
struct connection * c = malloc(sizeof(struct connection));
if (NULL == c)
@@ -32,15 +29,9 @@ struct connection * connection_new(lua_State * L, const int client)
}
/// Frees all resources associated with the connection.
-/// \param L Server's Lua state
/// \param c Connection to free
-void connection_free(lua_State * L, struct connection * c)
+void connection_free(struct connection * c)
{
- if (LUA_NOREF != c->ref)
- {
- luaL_unref(L, LUA_REGISTRYINDEX, c->ref);
- }
-
close(c->fd); // TODO: Check for errors in close()?
free(c);
}