diff -r 99a34860c105 -r d938228c382e src/server/safs/objecttype.c --- a/src/server/safs/objecttype.c Wed Nov 02 19:19:01 2022 +0100 +++ b/src/server/safs/objecttype.c Sun Nov 06 15:53:32 2022 +0100 @@ -26,8 +26,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include +#include +#include #include "objecttype.h" #include "../util/pblock.h" @@ -36,15 +36,15 @@ #include "../daemon/session.h" int object_type_by_extension(pblock *pb, Session *sn, Request *rq) { - sstr_t path = sstr(pblock_findkeyval(pb_key_path, rq->vars)); + cxstring path = cx_str(pblock_findkeyval(pb_key_path, rq->vars)); //printf("\nobject_type_by_extension: {%s}[%d]\n\n", path); - sstr_t ct; + cxstring ct; if(path.ptr[path.length - 1] == '/') { // directory - ct = sstrn("internal/directory", 18); + ct = (cxstring)CX_STR("internal/directory"); } else { - sstr_t ext; + cxstring ext; ext.length = 0; for(int i=path.length - 1;i>=0;i--) { if(path.ptr[i] == '.') { @@ -66,7 +66,7 @@ WS_ASSERT(config->mimetypes); WS_ASSERT(config->mimetypes->map); - char *type = ucx_map_sstr_get(config->mimetypes->map, ext); + char *type = cxMapGet(config->mimetypes->map, cx_hash_key_bytes((const unsigned char*)ext.ptr, ext.length)); if(!type) { return REQ_NOACTION;