src/server/safs/objecttype.c

changeset 415
d938228c382e
parent 201
196a3caebdc7
child 428
ab58e46b50a5
--- 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 <ucx/string.h>
-#include <ucx/map.h>
+#include <cx/string.h>
+#include <cx/map.h>
 
 #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;

mercurial