lprintf(9, "output_static('%s') [%s] -- NOT FOUND --\n", what, ChrPtr(WC->Hdr->this_page));
hprintf("HTTP/1.1 404 %s\r\n", strerror(errno));
hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
wprintf("Cannot open %s: %s\r\n", what, strerror(errno));
end_burst();
} else {
lprintf(9, "output_static('%s') -- FSTAT FAILED --\n", what);
hprintf("HTTP/1.1 404 %s\r\n", strerror(errno));
hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
wprintf("Cannot fstat %s: %s\n", what, strerror(errno));
end_burst();
return;
#endif
d_without_ext = d_namelen;
+ if (filedir_entry->d_type == DT_UNKNOWN) {
+ struct stat s;
+ char path[PATH_MAX];
+ snprintf(path, PATH_MAX, "%s/%s",
+ DirName, filedir_entry->d_name);
+ if (stat(path, &s) == 0) {
+ filedir_entry->d_type = IFTODT(s.st_mode);
+ }
+ }
+
if ((d_namelen > 1) && filedir_entry->d_name[d_namelen - 1] == '~')
continue; /* Ignore backup files... */