Changes between Version 1 and Version 2 of Developer/Mongoose_Web_Server


Ignore:
Timestamp:
Jan 2, 2016, 3:16:10 AM (4 years ago)
Author:
Nick Withers
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Mongoose_Web_Server

    v1 v2  
    11= Mongoose Web Server =
    2 
    32
    43This page aims to help application developers integrate the [https://github.com/valenok/mongoose/ Mongoose] Web / HTTP server into their RTEMS applications. Only a reasonably basic configuration is treated.
     
    87 *  networking is already configured and working in the application
    98 *  a file-system (from which to serve web pages and write logs to) is already configured and working in the application
     9
    1010=  What is it?  =
    1111
    1212Mongoose is a lightweight web server, one of two (the other being the [wiki:TBR/UserManual/Simple_HTTPD Simple HTTPD] server) available in RTEMS.
     13
     14Unfortunately, recent versions of the server have moved to an RTEMS-incompatible license and thus it is not up-to-date in RTEMS. It is anticipated that it will be removed at some future date.
     15
    1316=  Prerequisites  =
    1417
    15 RTEMS must have been configured (that is, with the GNU Configure tool), with the ''--enable-httpd'' and ''--enable-networking'' options. Because Mongoose uses the POSIX API, ''--disable-posix'' should ''not'' be specified.
     18RTEMS must have been configured with networking and POSIX interfaces enabled.
     19
    1620=  Library  =
    1721
     
    2226LD_LIBS+=-lmghttpd
    2327}}}
     28
    2429=  CONFIGURE / confdefs.h  =
    2530
     
    3035#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
    3136}}}
     37
    3238=  Initializing Mongoose  =
    3339
    3440{{{
    35 #include <mghttpd/mongoose.h
     41#include <mghttpd/mongoose.h>
    3642}}}
    3743in the source file you'll initialize Mongoose from.
     
    4349
    4450For the basic configuration described here, ''NULL'' can be passed for the ''user_data'' parameter, but ''callback'' '''must''' be provided. To initialise a structure with no callbacks enabled, use:
    45   {{{
     51{{{
    4652struct mg_callbacks callbacks = { NULL };
    4753}}}
    4854
    49 The ''options'' parameter is a ''NULL''-terminated array of string pairs, each pair giving an option name and a value (see the Mongoose documentation for a [https://docs.cesanta.com/Options.shtml description of options]). By way of example, though, ''options'' might be defined as such:
    50    {{{
     55The ''options'' parameter is a ''NULL''-terminated array of string pairs, each pair giving an option name and a value (see the Mongoose documentation for a [https://docs.cesanta.com/Options.shtml description of options]). By way of example, ''options'' might be defined as such:
     56{{{
    5157 const char *options[] = {
    5258   "document_root",   "/usr/www",
     
    6369
    6470This context is used for further operating on that Mongoose instance (for example, in calling ''mg_stop()'' to halt it).
     71
    6572=  Done!  =
    6673