URL
https://opencores.org/ocsvn/mlite/mlite/trunk
[/] [mlite/] [trunk/] [kernel/] [http.c] - Diff between revs 155 and 161
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 155 |
Rev 161 |
Line 92... |
Line 92... |
length = (int)fread(page, 1, 1024*1024*8, file);
|
length = (int)fread(page, 1, 1024*1024*8, file);
|
fclose(file);
|
fclose(file);
|
}
|
}
|
}
|
}
|
#endif
|
#endif
|
if(length != -1)
|
if(length != HTML_LENGTH_LIST_END)
|
{
|
{
|
if(length == -2)
|
if(length == HTML_LENGTH_CALLBACK)
|
{
|
{
|
IPFuncPtr funcPtr = (IPFuncPtr)page;
|
IPFuncPtr funcPtr = (IPFuncPtr)page;
|
funcPtr(socket, buf);
|
funcPtr(socket, buf, bytes);
|
return;
|
return;
|
}
|
}
|
if(length == 0)
|
if(length == 0)
|
length = (int)strlen(page);
|
length = (int)strlen(page);
|
needFooter = 0;
|
needFooter = 0;
|
Line 143... |
Line 143... |
}
|
}
|
|
|
|
|
#if 0
|
#if 0
|
//Example test code
|
//Example test code
|
static void MyProg(IPSocket *socket, char *request)
|
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)request; (void)bytes;
|
IPWrite(socket, text, (int)strlen(text));
|
IPWrite(socket, text, (int)strlen(text));
|
IPClose(socket);
|
IPClose(socket);
|
}
|
}
|
static const PageEntry_t pageEntry[]=
|
static const PageEntry_t pageEntry[]=
|
{ //name, length, htmlText
|
{ //name, length, htmlText
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.