aboutsummaryrefslogtreecommitdiff
path: root/src/net.c
diff options
context:
space:
mode:
authoramy <[email protected]>2025-04-14 14:09:22 -0500
committerGitHub <[email protected]>2025-04-14 14:09:22 -0500
commitdd7a8af4050454c3901987bff24a77334f892cc4 (patch)
tree48c6107656e14cfbbcbb49424fc3454de850a5db /src/net.c
parent44c68aa7d51ea6b50c442bfbfa4ce11c530d2f7d (diff)
parentdc7e4527e88ed0c59e17c0ff04c01e1c92136e42 (diff)
Merge pull request #1 from ameliasquires/new-config
updates how config values are updated, support for local values when copying states, and annotations
Diffstat (limited to 'src/net.c')
-rw-r--r--src/net.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/net.c b/src/net.c
index 32ab8dd..9089f49 100644
--- a/src/net.c
+++ b/src/net.c
@@ -556,7 +556,7 @@ int l_srequest(lua_State* L){
int l_request(lua_State* L){
const char* host = luaL_checkstring(L, 1);
- int sock = get_host((char*)host, lua_tostring(L, 2));
+ int sock = get_host((char*)host, (char*)lua_tostring(L, 2));
char* path = "/";
if(lua_gettop(L) >= 3)
@@ -798,7 +798,7 @@ void* handle_client(void *_arg){
}
parray_clear(par, FREE);
- luaI_tsetv(L, req_idx, "paramaters", new_param_idx);
+ luaI_tsetv(L, req_idx, "parameters", new_param_idx);
for(int z = 0; z != awa->len; z++){
char* path;
@@ -809,6 +809,7 @@ void* handle_client(void *_arg){
luaL_loadbuffer(L, wowa->c, wowa->len, "fun");
int func = lua_gettop(L);
+ lua_assign_upvalues(L, func);
//lua_pushvalue(L, func); // push function call
lua_pushvalue(L, res_idx); //push methods related to dealing with the request
@@ -816,6 +817,7 @@ void* handle_client(void *_arg){
//call the function
if(lua_pcall(L, 2, 0, 0) != 0){
+ printf("(net thread) %s\n", lua_tostring(L, -1));
//send an error message if send has not been called
if(client_fd >= 0) net_error(client_fd, 500);
@@ -941,7 +943,7 @@ int start_serv(lua_State* L, int port){
lua_getglobal(L, "_G");
//time_start(copy)
- luaI_deepcopy(L, args->L, SKIP_GC);
+ luaI_copyvars(L, args->L);
//time_end("copy", copy)
lua_settop(L, old_top);