Index: filed.c ================================================================== --- filed.c +++ filed.c @@ -561,11 +561,10 @@ } /* Open a file and return file information */ static struct filed_fileinfo *filed_open_file(const char *path, struct filed_fileinfo *buffer) { struct filed_fileinfo *cache; - const char *open_path; unsigned int cache_idx; off_t len; int fd; cache_idx = filed_hash((const unsigned char *) path, filed_fileinfo_fdcache_size); @@ -579,18 +578,11 @@ filed_log_msg_debug("Completed locking mutex for idx: %lu", (unsigned long) cache_idx); if (strcmp(path, cache->path) != 0) { filed_log_msg_debug("Cache miss for idx: %lu: OLD \"%s\", NEW \"%s\"", (unsigned long) cache_idx, cache->path, path); - /* For requests for the root directory, serve out index.html */ - if (path[0] == '\0' || (path[0] == '/' && path[1] == '\0')) { - open_path = "/index.html"; - } else { - open_path = path; - } - - fd = open(open_path, O_RDONLY | O_LARGEFILE); + fd = open(path, O_RDONLY | O_LARGEFILE); if (fd < 0) { pthread_mutex_unlock(&cache->mutex); return(NULL); } @@ -603,11 +595,11 @@ lseek(fd, 0, SEEK_SET); cache->fd = fd; cache->len = len; strcpy(cache->path, path); - cache->type = filed_determine_mimetype(open_path); + cache->type = filed_determine_mimetype(path); filed_generate_etag(cache->etag, sizeof(cache->etag)); /* XXX:TODO: Determine */ cache->lastmod = filed_format_time(cache->lastmod_b, sizeof(cache->lastmod_b), time(NULL) - 30); } else {