mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 02:03:34 +08:00
Add default file name if URL is a directory, giving index.html behavior. From Kate
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5162 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -89,6 +89,18 @@ int httpd_mmap_open(const char *name, struct httpd_fs_file *file)
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
if (S_ISDIR(st.st_mode))
|
||||
{
|
||||
errno = EISDIR;
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
if (!S_ISREG(st.st_mode))
|
||||
{
|
||||
errno = ENOENT;
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
if (st.st_size > INT_MAX)
|
||||
{
|
||||
errno = EFBIG;
|
||||
|
||||
Reference in New Issue
Block a user