mirror of
https://github.com/SDL-Hercules-390/hyperion.git
synced 2026-08-06 00:29:07 +02:00
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:
+6
-2
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user