diff options
| author | ame <[email protected]> | 2024-04-15 21:39:38 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-04-15 21:39:38 -0500 |
| commit | fd71d9f9db5c50f6b13d79a5879298f5c23b32d8 (patch) | |
| tree | 8b79372912df6f1090a9adabbe8df2877cb7fcd5 | |
| parent | 14e3ec0e4cf84b5e5fcc19b2e3c1a6bb0ca8787d (diff) | |
roll fix
| -rw-r--r-- | src/net.c | 8 | ||||
| -rw-r--r-- | tests/net.lua | 2 |
2 files changed, 4 insertions, 6 deletions
@@ -580,17 +580,15 @@ int rolling_file_parse(lua_State* L, int* files_idx, int* body_idx, char* buffer if(old==NULL) old = str_init("");
for(int i = 0; i < blen; i++){
-
+ //printf("%c",buffer[i]);
if(boundary->c[old->len - *dash_count] == buffer[i] || buffer[i] == '-'){
str_pushl(old, buffer + i, 1);
if(buffer[i] == '-') (*dash_count)++;
if(old->len - *dash_count >= boundary->len){
- luaI_tsets(L, rfiles_idx, "content", current->c);
- /*lua_pushinteger(L, lua_rawlen(L, *files_idx) + 1);
- lua_pushvalue(L, *table_idx);
- lua_settable(L, *files_idx);*/
+ luaI_tsetsl(L, rfiles_idx, "content", current->c, current->len);
+
for(; i < blen; i++) if(buffer[i] == '\n') break;
str_clear(current);
*status = BARRIER_READ;
diff --git a/tests/net.lua b/tests/net.lua index 53bcbe1..243d958 100644 --- a/tests/net.lua +++ b/tests/net.lua @@ -52,7 +52,7 @@ llib.net.listen( a = req:roll(100000)
--print(a)
end
- --_G.llib.io.pprint(req)
+ print(req.files[1].content)
--_G.llib.io.pprint(req)
--_G.llib.io.pprint("hi")
--res:send("")
|
