diff options
| author | ame <[email protected]> | 2024-02-23 13:08:49 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2024-02-23 13:08:49 -0600 |
| commit | 9488d1ff2737eb183bc140cbe891b7aaf3d2a656 (patch) | |
| tree | 3437a24089a01af4162f3bff309f614efb1d2f19 | |
| parent | 983800c02af8789829732f6205b46ccb73dd4993 (diff) | |
prolly changed stuff
| -rw-r--r-- | src/net.c | 7 | ||||
| -rw-r--r-- | tests/net.lua | 3 |
2 files changed, 7 insertions, 3 deletions
@@ -26,7 +26,8 @@ #include "types/parray.h"
#define max_con 200
-#define BUFFER_SIZE 2048
+//2^42
+#define BUFFER_SIZE 67108864
static int ports[65535] = { 0 };
static parray_t* paths = NULL;
@@ -78,6 +79,7 @@ int64_t recv_full_buffer(int client_fd, char** _buffer, int* header_eof){ *_buffer = buffer;
return len + BUFFER_SIZE;
}
+
str* cont_len_str = str_init("");
if(cont_len_raw == NULL) abort();
//i is length of 'Content-Length: '
@@ -86,7 +88,7 @@ int64_t recv_full_buffer(int client_fd, char** _buffer, int* header_eof){ str_free(cont_len_str);
}
-
+
len += n;
buffer = realloc(buffer, len + BUFFER_SIZE);
@@ -584,6 +586,7 @@ void* handle_client(void *_arg){ if(sT != NULL && bytes_received > 0){
char* new_cont;
int pf = file_parse(L, buffer + header_eof, sT, &new_cont, bytes_received - header_eof);
+
if(pf >= 0){
luaI_tsetv(L, req_idx, "files", pf);
parray_set(table, "Body", (void*)str_init(new_cont));
diff --git a/tests/net.lua b/tests/net.lua index 7fac0ad..cb51ab5 100644 --- a/tests/net.lua +++ b/tests/net.lua @@ -1,5 +1,5 @@ require "llib"
-llib.config.set({max_depth=4})
+llib.config.set({max_depth=1})
--local print = llib.io.pprint
sleep = function(a)
local sec = tonumber(os.clock() + a);
@@ -42,6 +42,7 @@ llib.net.listen( --_G.llib.io.pprint(_G.llib.io.readfile(".gitignore"))
--print(req._bytes)
--res:send(_G.llib.io.readfile("llib.dll"))
+ --_G.llib.io.pprint(_G.llib.crypto.md5(_G.llib.io.readfile(".gitignore")))
_G.llib.io.pprint(req)
end)
|
