We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all, I'm trying to figure out the logic behind the TCPNet HTTP server in terms of locating the site's default page.
What if I try to browse the site by only specifying the host in url ( i.e. http://myboard/ )? Is it looking for an hardcoded index.html? What if this file is not present or, at least, not in the FileTab table?
As far as I can get, if index.html is not present in FileTab the first file is used instead, but I can't get it working well if this first file is a .cgi.
Am I doing any wrong assumption?
TIA
It is correct.
The TCPnet HTTP server is first looking for index.html on a FlashFS drive (if an interface has been configured properly).
If the file is not found or interface not enabled, it looks for a hardcoded index.html in FileTab.
If not found it takes the first file from the FileTab. You should put a valid default page there.
Franc
Hi Franc, thanks for replying.
> The TCPnet HTTP server is first looking for index.html on a FlashFS drive (if an interface has been configured properly).
This sounds interesting. I'm using a pseudo-filesystem on a serial flash device. I know I could have used FlashFS instead, but the implementation I have works for me. I defined the interface in http_uif.c by implementing http_fopen(), http_fclose() and http_fread() functions. Is this not enough to consider the interface properly configured? Do I have to have FlashFS enabled? My index.html is on the serial flash but what I see is that the http server still looks for the first file from the FileTab. Any idea what could be wrong in my setup?
I'd like to store my index.html on the flash device to save precious memory.
TIA Andrea
Interface properly configured means when HTTP server wants to open a file, that your File System opens it. When HTTP server wants to read data from the file, that your File System reads the data from a file to a buffer etc. That's all.
You do not have to have FlashFS enabled. HTTP Server has no idea what File System is behind http_fopen(), http_fclose() and http_fread() functions. As long as File System works as expected, then HTTP Server should work with ANY file system behind.
Franc, It was my fault. I was using "index.html" instead of "index.htm" as default page's name on my filesystem. I renamed the file and now it's working fine.
Thanks again! Andrea