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

Subversion Repositories mlite

[/] [mlite/] [trunk/] [kernel/] [http.c] - Diff between revs 162 and 172

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

Rev 162 Rev 172
Line 18... Line 18...
#endif
#endif
#include "rtos.h"
#include "rtos.h"
#include "tcpip.h"
#include "tcpip.h"
#ifdef WIN32
#ifdef WIN32
#define UartPrintf printf
#define UartPrintf printf
#else
 
#undef printf
 
#define printf UartPrintfPoll
 
//#define printf UartPrintfNull
 
#endif
#endif
 
 
const char pageGif[]=
const char pageGif[]=
{
{
   "HTTP/1.0 200 OK\r\n"
   "HTTP/1.0 200 OK\r\n"
Line 101... Line 97...
#endif
#endif
         if(length != HTML_LENGTH_LIST_END)
         if(length != HTML_LENGTH_LIST_END)
         {
         {
            if(length == HTML_LENGTH_CALLBACK)
            if(length == HTML_LENGTH_CALLBACK)
            {
            {
               IPFuncPtr funcPtr = (IPFuncPtr)page;
               IPFuncPtr funcPtr = (IPFuncPtr)(uint32)page;
               funcPtr(socket, buf, bytes);
               funcPtr(socket, buf, bytes);
               return;
               return;
            }
            }
            if(length == 0)
            if(length == 0)
               length = (int)strlen(page);
               length = (int)strlen(page);
Line 163... Line 159...
 
 
void HttpInit(const PageEntry_t *Pages, int UseFiles)
void HttpInit(const PageEntry_t *Pages, int UseFiles)
{
{
   HtmlPages = Pages;
   HtmlPages = Pages;
   HtmlFiles = UseFiles;
   HtmlFiles = UseFiles;
   HttpMQueue = OS_MQueueCreate("http", 100, 4);
   HttpMQueue = OS_MQueueCreate("http", FRAME_COUNT, 4);
   OS_ThreadCreate("http", HttpThread, NULL, 50, 0);
   OS_ThreadCreate("http", HttpThread, NULL, 50, 0);
   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);
}
}
 
 

powered by: WebSVN 2.1.0

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