Additional filetype check and enhanced error logging

git-svn-id: file:///home/jj/hercules.svn/trunk@775 956126f8-22a0-4046-8f4a-272fa8102e63
This commit is contained in:
Jan Jaeger
2002-03-30 20:17:00 +00:00
parent b04214fab0
commit 6df5847d58
+6 -2
View File
@@ -387,12 +387,16 @@ static void http_download(WEBBLK *webblk, char *filename)
if(stat(fullname,&st))
http_error(webblk, "404 File Not Found","",
"The requested file was not found");
strerror(errno));
if(!S_ISREG(st.st_mode))
http_error(webblk, "404 File Not Found","",
"The requested file is not a regular file");
fd = open(fullname,O_RDONLY,0);
if (fd == -1) {
http_error(webblk, "404 File Not Found","",
"The requested file was not found");
strerror(errno));
}
fprintf(webblk->hsock,"HTTP/1.0 200 OK\n");