Changeset 0fe6b0d in network-demos


Ignore:
Timestamp:
11/23/09 14:31:53 (14 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 57a009d5b89e72f488ab655184e6a33bb0fe6b7f, network-demos-4-10-branch
Children:
81f6c2e
Parents:
6ecabe8
Message:

2009-11-23 Joel Sherrill <joel.sherrill@…>

  • Makefile, goahead_index.html, init.c, shttpd_ext.c, shttpd_index.html: Add Mongoose HTTPD support.
  • mongoose_ext.c, mongoose_index.html: New files.
Location:
http
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • http/ChangeLog

    r6ecabe8 r0fe6b0d  
     12009-11-23      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile, goahead_index.html, init.c, shttpd_ext.c,
     4        shttpd_index.html: Add Mongoose HTTPD support.
     5        * mongoose_ext.c, mongoose_index.html: New files.
     6
    172009-05-13      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • http/Makefile

    r6ecabe8 r0fe6b0d  
    99
    1010# C source names, if any, go here -- minus the .c
    11 C_PIECES=init FilesystemImage shttpd_ext
     11C_PIECES=init FilesystemImage shttpd_ext mongoose_ext
    1212C_FILES=$(C_PIECES:%=%.c)
    1313C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
     
    4343## FYI GoAhead requires POSIX to be enabled
    4444USE_GOAHEAD=no
    45 USE_SIMPLE=yes
     45USE_SIMPLE=no
     46USE_MONGOOSE=yes
    4647USE_FTPD=yes
    4748ifeq ($(USE_GOAHEAD),yes)
     
    5556  CFLAGS   += -DUSE_SIMPLE_HTTPD
    5657  override LD_LIBS  += -lshttpd
     58endif
     59
     60ifeq ($(USE_MONGOOSE),yes)
     61  HTTPD     = Mongoose HTTPD Web Server
     62  CFLAGS   += -DUSE_MONGOOSE_HTTPD
     63  override LD_LIBS  += -lmghttpd
    5764endif
    5865
     
    8895        $(PROJECT_ROOT)/bin/rtems-bin2c FilesystemImage FilesystemImage
    8996
    90 rootfs/index.html: shttpd_index.html goahead_index.html
     97rootfs/index.html: shttpd_index.html goahead_index.html mongoose_index.html
    9198ifeq ($(USE_SIMPLE),yes)
    9299        cp shttpd_index.html rootfs/index.html
     
    94101ifeq ($(USE_GOHEAD),yes)
    95102        cp goahead_index.html rootfs/index.html
     103endif
     104ifeq ($(USE_MONGOOSE),yes)
     105        cp mongoose_index.html rootfs/index.html
    96106endif
    97107
  • http/goahead_index.html

    r6ecabe8 r0fe6b0d  
    11<HTML>
    2 <HEAD><TITLE>RTEMS @SERVER@ Test Page</TITLE></HEAD>
     2<HEAD><TITLE>RTEMS GoAhead Test Page</TITLE></HEAD>
    33<BODY BGCOLOR="FFFFFF">
    44<center>
  • http/init.c

    r6ecabe8 r0fe6b0d  
    8181#else
    8282  bool Simple_HTTPD_enabled = false;
     83#endif
     84
     85#if defined(USE_MONGOOSE_HTTPD)
     86  #include <mghttpd/mongoose.h>
     87
     88  void example_mongoose_addpages(
     89    struct mg_context *server
     90  );
    8391#endif
    8492
     
    146154  #endif
    147155
     156  #if defined(USE_MONGOOSE_HTTPD)
     157    {
     158      struct mg_context *WebServer;
     159      printf( "Initializing Mongoose HTTPD\n" );
     160      WebServer = mg_start();
     161
     162      mg_set_option(WebServer, "root", "/" );
     163      mg_set_option(WebServer, "ports", "80" );
     164      example_mongoose_addpages( WebServer );
     165
     166    }
     167  #endif
    148168  status = rtems_task_delete( RTEMS_SELF );
    149169}
     
    163183#define CONFIGURE_MAXIMUM_TASKS         20
    164184
     185#if defined(USE_MONGOOSE_HTTPD)
     186#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
     187#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 30
     188#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
     189#define CONFIGURE_MINIMUM_TASK_STACK_SIZE (32 * 1024)
     190#define CONFIGURE_UNIFIED_WORK_AREAS
     191#endif
     192
    165193#define CONFIGURE_MICROSECONDS_PER_TICK 10000
    166194
  • http/shttpd_ext.c

    r6ecabe8 r0fe6b0d  
    3131
    3232  if ( !strcmp( query, "cpuuse_report" ) ) {
     33
     34    shttpd_printf( arg, "<pre>" );
    3335    rtems_cpu_usage_report_with_plugin(
    3436      arg,
    3537      (rtems_printk_plugin_t) shttpd_printf
    3638    );
     39    shttpd_printf( arg, "</pre>" );
    3740  } else if ( !strcmp( query, "cpuuse_reset" ) ) {
    3841    rtems_cpu_usage_reset();
     
    4447    );
    4548  } else if ( !strcmp( query, "stackuse_report" ) ) {
     49    shttpd_printf( arg, "<pre>" );
    4650    rtems_stack_checker_report_usage_with_plugin(
    4751      arg,
    4852      (rtems_printk_plugin_t) shttpd_printf
    4953    );
     54    shttpd_printf( arg, "</pre>" );
    5055  } else {
    5156    shttpd_printf(
  • http/shttpd_index.html

    r6ecabe8 r0fe6b0d  
    3030  <LI><A HREF="queries?stackuse_report">Stack Usage -- Report</LI>
    3131</UL>
    32 </big>
    3332
    3433</BODY></HTML>
Note: See TracChangeset for help on using the changeset viewer.