837
837
URIHANDLER_FUNC(mod_dirlisting_subrequest) {
839
839
stat_cache_entry *sce = NULL;
843
843
if (con->physical.path->used == 0) return HANDLER_GO_ON;
844
844
if (con->uri.path->used == 0) return HANDLER_GO_ON;
845
845
if (con->uri.path->ptr[con->uri.path->used - 2] != '/') return HANDLER_GO_ON;
847
847
mod_dirlisting_patch_connection(srv, con, p);
849
849
if (!p->conf.dir_listing) return HANDLER_GO_ON;
851
851
if (con->conf.log_request_handling) {
852
852
log_error_write(srv, __FILE__, __LINE__, "s", "-- handling the request as Dir-Listing");
853
853
log_error_write(srv, __FILE__, __LINE__, "sb", "URI :", con->uri.path);
856
856
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
857
857
fprintf(stderr, "%s.%d: %s\n", __FILE__, __LINE__, con->physical.path->ptr);
861
861
if (!S_ISDIR(sce->st.st_mode)) return HANDLER_GO_ON;
863
863
if (http_list_directory(srv, con, p, con->physical.path)) {
868
868
buffer_reset(con->physical.path);