diff options
| author | ame <[email protected]> | 2024-02-28 11:55:37 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2024-02-28 11:55:37 -0600 |
| commit | 03eaa13bcff97661c67b3f2ba1c62147c5ba846c (patch) | |
| tree | 243200db2e3a69fe80ff3271195aacebb1ce2fcd | |
| parent | 3d583677802859b77fac96170b5c7fe81c99cf58 (diff) | |
less slow
| -rw-r--r-- | src/net.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -497,6 +497,7 @@ int file_parse(lua_State* L, char* buffer, str* content_type, size_t blen){ str* current = str_init("");
int key = -1;
int cont_disp = 0;
+
for(char* s = ind + boundary->len + 2; s != header_eof; s++){
if(*s == ':'){
@@ -530,19 +531,19 @@ int file_parse(lua_State* L, char* buffer, str* content_type, size_t blen){ }
}
- str_free(current);
- luaI_tsets(L, file_T , luaL_checkstring(L, key), current->c);
+ //str_free(current);
+ //luaI_tsets(L, file_T , luaL_checkstring(L, key), current->c);
- str_pushl(file, header_eof + 2, ending_ind - header_eof - 4);
+ //str_pushl(file, header_eof + 2, ending_ind - header_eof - 4);
lua_pushstring(L, "content");
- lua_pushlstring(L, file->c, file->len);
+ lua_pushlstring(L, header_eof + 2, ending_ind - header_eof - 4);
lua_settable(L, file_T);
blen = end - ending_ind;
buffer = ending_ind;
- str_free(file);
+ //str_free(file);
lua_pushinteger(L, i);
lua_pushvalue(L, file_T);
|
