OpenCores
URL https://opencores.org/ocsvn/mlite/mlite/trunk

Subversion Repositories mlite

[/] [mlite/] [trunk/] [kernel/] [http.c] - Diff between revs 244 and 302

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 244 Rev 302
Line 73... Line 73...
 
 
 
 
void HttpServer(IPSocket *socket)
void HttpServer(IPSocket *socket)
{
{
   uint8 buf[600];
   uint8 buf[600];
 
   char filename[80];
   int bytes, i, length, len, needFooter;
   int bytes, i, length, len, needFooter;
   char *name=NULL, *page=NULL;
   char *name=NULL, *page=NULL;
   const char *header, *header2;
   const char *header, *header2;
 
 
   if(socket == NULL)
   if(socket == NULL)
Line 106... Line 107...
 
 
            name = (char*)buf + 5;
            name = (char*)buf + 5;
            ptr = strstr(name, " ");
            ptr = strstr(name, " ");
            if(ptr)
            if(ptr)
               *ptr = 0;
               *ptr = 0;
            file = fopen(name, "rb");
            strcpy(filename, "/web/");
 
            strncat(filename, name, 60);
 
            file = fopen(filename, "rb");
 
            if(file == NULL)
 
            {
 
               strcpy(filename, "/flash/web/");
 
               strncat(filename, name, 60);
 
               file = fopen(filename, "rb");
 
            }
            if(file)
            if(file)
            {
            {
               if(strstr(name, ".htm"))
               if(strstr(name, ".htm"))
                  IPWrite(socket, (uint8*)pageHtml2, sizeof(pageHtml2));
                  IPWrite(socket, (uint8*)pageHtml2, sizeof(pageHtml2));
               else if(strstr(name, ".gif"))
               else if(strstr(name, ".gif"))

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.