Keil Logo

RL-ARM: RL-TCPNet: index.cgi on external storage medium not used

Information in this knowledgebase article applies to:

  • RL-TCPNet HTTP server


All my web content is stored on an external storage medium (like a SD-Card). In the TCPNet manual is written, that as an alternative to "index.htm" an other default web page "index.cgi" is used. As mentioned in the manual, I have no "index.htm" among my web content files. However, my default "index.cgi" will not be used.


When no filename is specified in the requested url, the HTTP server will look for some default file, which is "index.htm". If this is not found, it will retry with "index.cgi".
The HTTP server generally looks first on the external medium for a file by calling http_fopen(). If it is not found, it continues to look for it in the internal file system, which is the output of the FCARM utility, usually Web.c.
When the application does not provide content in the internal file system by not adding a Web.c file to the project, the TCPNet library will include it's own small Web.c with weak references in the project. This default internal content consists of a small "index.htm" file.
So the problem in this scenario is, that when there is no "index.htm" on the external medium, it always finds one internally. So the HTTP server will not try again with "index.cgi" as it is already happy with the internal "index.htm".


To disable the default internal "index.htm" the application has to supply it's own internal content that does not contain a "index.htm" file. That can, as shown in the attached Web.c, also be a "empty" Web.c file which contains no files, but just replaces the internal default contest when added to the project.
As then there is also no internal "index.htm, the HTTP server will retry with looking for "index.cgi".



Request the files attached to this knowledgebase article.

Last Reviewed: Friday, June 7, 2013

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.