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

Subversion Repositories mlite

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

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

Rev 237 Rev 244
Line 183... Line 183...
   IPOpen(IP_MODE_TCP, 0, 80, HttpServer);
   IPOpen(IP_MODE_TCP, 0, 80, HttpServer);
   IPOpen(IP_MODE_TCP, 0, 8080, HttpServer);
   IPOpen(IP_MODE_TCP, 0, 8080, HttpServer);
}
}
 
 
 
 
#if 0
#ifdef EXAMPLE_HTML
//Example test code
//Example test code
static void MyProg(IPSocket *socket, char *request, int bytes)
static void MyProg(IPSocket *socket, char *request, int bytes)
{
{
   char *text="HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"
   char *text="HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"
              "<html><body>Hello World!</body></html>";
              "<html><body>Hello World!</body></html>";
   (void)request; (void)bytes;
   (void)request; (void)bytes;
   IPWrite(socket, text, (int)strlen(text));
   IPWrite(socket, (uint8*)text, (int)strlen(text));
   IPClose(socket);
   IPClose(socket);
}
}
static const PageEntry_t pageEntry[]=
static const PageEntry_t pageEntry[]=
{  //name, length, htmlText
{  //name, length, htmlText
   {"/Header", 0, "<HTML><HEAD><TITLE>Plasma CPU</TITLE></HEAD>\n<BODY>"},
   {"/Header", 0, "<HTML><HEAD><TITLE>Plasma CPU</TITLE></HEAD>\n<BODY>"},
Line 204... Line 204...
   {"/other.htm ", 0, "<h2>Other</h2>Other."},
   {"/other.htm ", 0, "<h2>Other</h2>Other."},
   //{"/binary/plasma.gif ", 1945, PlasmaGif},
   //{"/binary/plasma.gif ", 1945, PlasmaGif},
   {"/cgi/myprog", HTML_LENGTH_CALLBACK, (char*)MyProg},
   {"/cgi/myprog", HTML_LENGTH_CALLBACK, (char*)MyProg},
   {"", HTML_LENGTH_LIST_END, NULL}
   {"", HTML_LENGTH_LIST_END, NULL}
};
};
void HttpTest(void)
void HtmlInit(int UseFiles)
{
{
 
   (void)UseFiles;
   HttpInit(pageEntry, 1);
   HttpInit(pageEntry, 1);
}
}
#endif
#endif
 
 
 
 

powered by: WebSVN 2.1.0

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