| 35 #include "../util/io.h" |
35 #include "../util/io.h" |
| 36 #include "../util/pblock.h" |
36 #include "../util/pblock.h" |
| 37 #include "../util/util.h" |
37 #include "../util/util.h" |
| 38 #include "../daemon/protocol.h" |
38 #include "../daemon/protocol.h" |
| 39 #include "../daemon/vfs.h" |
39 #include "../daemon/vfs.h" |
| |
40 #include "../daemon/httprequest.h" |
| 40 |
41 |
| 41 #include "../util/strbuf.h" |
42 #include "../util/strbuf.h" |
| 42 #include <cx/string.h> |
43 #include <cx/string.h> |
| 43 #include <cx/linked_list.h> |
44 #include <cx/linked_list.h> |
| 44 #include <cx/printf.h> |
45 #include <cx/printf.h> |
| 820 } |
821 } |
| 821 return strcmp(a->name, b->name); |
822 return strcmp(a->name, b->name); |
| 822 } |
823 } |
| 823 |
824 |
| 824 int service_index(pblock *pb, Session *sn, Request *rq) { |
825 int service_index(pblock *pb, Session *sn, Request *rq) { |
| |
826 NSAPIRequest *req = (NSAPIRequest*)rq; |
| |
827 if(req->location && req->location->set_dirindex && !req->location->dirindex) { |
| |
828 return REQ_NOACTION; |
| |
829 } |
| |
830 |
| 825 //printf("service_index\n"); |
831 //printf("service_index\n"); |
| 826 const CxAllocator *a = pool_allocator(sn->pool); |
832 const CxAllocator *a = pool_allocator(sn->pool); |
| 827 |
833 |
| 828 char *path = pblock_findkeyval(pb_key_path, rq->vars); |
834 char *path = pblock_findkeyval(pb_key_path, rq->vars); |
| 829 cxstring uri = cx_str(pblock_findkeyval(pb_key_uri, rq->reqpb)); |
835 cxstring uri = cx_str(pblock_findkeyval(pb_key_uri, rq->reqpb)); |