Prusa MINI Firmware overview
Collaboration diagram for Options:

Macros

#define LWIP_HTTPD_CGI   0
 
#define LWIP_HTTPD_CGI_SSI   0
 
#define LWIP_HTTPD_SSI   0
 
#define LWIP_HTTPD_SSI_RAW   0
 
#define LWIP_HTTPD_SUPPORT_POST   0
 
#define LWIP_HTTPD_MAX_CGI_PARAMETERS   16
 
#define LWIP_HTTPD_SSI_MULTIPART   0
 
#define LWIP_HTTPD_MAX_TAG_NAME_LEN   8
 
#define LWIP_HTTPD_MAX_TAG_INSERT_LEN   192
 
#define LWIP_HTTPD_POST_MANUAL_WND   0
 
#define HTTPD_SERVER_AGENT   "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)"
 
#define LWIP_HTTPD_DYNAMIC_HEADERS   0
 
#define HTTPD_DEBUG   LWIP_DBG_OFF
 
#define HTTPD_USE_MEM_POOL   0
 
#define HTTPD_SERVER_PORT   80
 
#define HTTPD_MAX_RETRIES   4
 
#define HTTPD_POLL_INTERVAL   4
 
#define HTTPD_TCP_PRIO   TCP_PRIO_MIN
 
#define LWIP_HTTPD_TIMING   0
 
#define HTTPD_DEBUG_TIMING   LWIP_DBG_OFF
 
#define LWIP_HTTPD_SUPPORT_EXTSTATUS   0
 
#define LWIP_HTTPD_SUPPORT_V09   1
 
#define LWIP_HTTPD_SUPPORT_11_KEEPALIVE   0
 
#define LWIP_HTTPD_SUPPORT_REQUESTLIST   1
 
#define LWIP_HTTPD_REQ_QUEUELEN   5
 
#define LWIP_HTTPD_REQ_BUFSIZE   LWIP_HTTPD_MAX_REQ_LENGTH
 
#define LWIP_HTTPD_MAX_REQ_LENGTH   LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE))
 
#define LWIP_HTTPD_MAX_REQUEST_URI_LEN   63
 
#define LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN   63
 
#define LWIP_HTTPD_SSI_INCLUDE_TAG   1
 
#define LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR   0
 
#define LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED   0
 
#define LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI   0
 
#define HTTP_IS_TAG_VOLATILE(ptr)   TCP_WRITE_FLAG_COPY
 
#define HTTPD_LIMIT_SENDING_TO_2MSS   1
 
#define HTTPD_MAX_WRITE_LEN(pcb)   (2 * tcp_mss(pcb))
 
#define LWIP_HTTPD_CUSTOM_FILES   1
 
#define LWIP_HTTPD_DYNAMIC_FILE_READ   0
 
#define LWIP_HTTPD_FILE_STATE   0
 
#define HTTPD_PRECALCULATED_CHECKSUM   0
 
#define LWIP_HTTPD_FS_ASYNC_READ   0
 
#define HTTPD_USE_CUSTOM_FSDATA   0
 

Detailed Description

Macro Definition Documentation

◆ LWIP_HTTPD_CGI

#define LWIP_HTTPD_CGI   0

Set this to 1 to support CGI (old style)

◆ LWIP_HTTPD_CGI_SSI

#define LWIP_HTTPD_CGI_SSI   0

Set this to 1 to support CGI (new style)

◆ LWIP_HTTPD_SSI

#define LWIP_HTTPD_SSI   0

Set this to 1 to support SSI (Server-Side-Includes)

◆ LWIP_HTTPD_SSI_RAW

#define LWIP_HTTPD_SSI_RAW   0

Set this to 1 to implement an SSI tag handler callback that gets a const char* to the tag (instead of an index into a pre-registered array of known tags)

◆ LWIP_HTTPD_SUPPORT_POST

#define LWIP_HTTPD_SUPPORT_POST   0

Set this to 1 to support HTTP POST

◆ LWIP_HTTPD_MAX_CGI_PARAMETERS

#define LWIP_HTTPD_MAX_CGI_PARAMETERS   16

◆ LWIP_HTTPD_SSI_MULTIPART

#define LWIP_HTTPD_SSI_MULTIPART   0

LWIP_HTTPD_SSI_MULTIPART==1: SSI handler function is called with 2 more arguments indicating a counter for insert string that are too long to be inserted at once: the SSI handler function must then set 'next_tag_part' which will be passed back to it in the next call.

◆ LWIP_HTTPD_MAX_TAG_NAME_LEN

#define LWIP_HTTPD_MAX_TAG_NAME_LEN   8

◆ LWIP_HTTPD_MAX_TAG_INSERT_LEN

#define LWIP_HTTPD_MAX_TAG_INSERT_LEN   192

◆ LWIP_HTTPD_POST_MANUAL_WND

#define LWIP_HTTPD_POST_MANUAL_WND   0

◆ HTTPD_SERVER_AGENT

#define HTTPD_SERVER_AGENT   "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)"

This string is passed in the HTTP header as "Server: "

◆ LWIP_HTTPD_DYNAMIC_HEADERS

#define LWIP_HTTPD_DYNAMIC_HEADERS   0

Set this to 1 if you want to include code that creates HTTP headers at runtime. Default is off: HTTP headers are then created statically by the makefsdata tool. Static headers mean smaller code size, but the (readonly) fsdata will grow a bit as every file includes the HTTP header.

◆ HTTPD_DEBUG

#define HTTPD_DEBUG   LWIP_DBG_OFF

◆ HTTPD_USE_MEM_POOL

#define HTTPD_USE_MEM_POOL   0

Set this to 1 to use a memp pool for allocating struct http_state instead of the heap.

◆ HTTPD_SERVER_PORT

#define HTTPD_SERVER_PORT   80

The server port for HTTPD to use

◆ HTTPD_MAX_RETRIES

#define HTTPD_MAX_RETRIES   4

Maximum retries before the connection is aborted/closed.

  • number of times pcb->poll is called -> default is 4*500ms = 2s;
  • reset when pcb->sent is called

◆ HTTPD_POLL_INTERVAL

#define HTTPD_POLL_INTERVAL   4

The poll delay is X*500ms

◆ HTTPD_TCP_PRIO

#define HTTPD_TCP_PRIO   TCP_PRIO_MIN

Priority for tcp pcbs created by HTTPD (very low by default). Lower priorities get killed first when running out of memory.

◆ LWIP_HTTPD_TIMING

#define LWIP_HTTPD_TIMING   0

Set this to 1 to enable timing each file sent

◆ HTTPD_DEBUG_TIMING

#define HTTPD_DEBUG_TIMING   LWIP_DBG_OFF

Set this to 1 to enable timing each file sent

◆ LWIP_HTTPD_SUPPORT_EXTSTATUS

#define LWIP_HTTPD_SUPPORT_EXTSTATUS   0

Set this to one to show error pages when parsing a request fails instead of simply closing the connection.

◆ LWIP_HTTPD_SUPPORT_V09

#define LWIP_HTTPD_SUPPORT_V09   1

Set this to 0 to drop support for HTTP/0.9 clients (to save some bytes)

◆ LWIP_HTTPD_SUPPORT_11_KEEPALIVE

#define LWIP_HTTPD_SUPPORT_11_KEEPALIVE   0

Set this to 1 to enable HTTP/1.1 persistent connections. ATTENTION: If the generated file system includes HTTP headers, these must include the "Connection: keep-alive" header (pass argument "-11" to makefsdata).

◆ LWIP_HTTPD_SUPPORT_REQUESTLIST

#define LWIP_HTTPD_SUPPORT_REQUESTLIST   1

Set this to 1 to support HTTP request coming in in multiple packets/pbufs

◆ LWIP_HTTPD_REQ_QUEUELEN

#define LWIP_HTTPD_REQ_QUEUELEN   5

Number of rx pbufs to enqueue to parse an incoming request (up to the first newline)

◆ LWIP_HTTPD_REQ_BUFSIZE

#define LWIP_HTTPD_REQ_BUFSIZE   LWIP_HTTPD_MAX_REQ_LENGTH

Number of (TCP payload-) bytes (in pbufs) to enqueue to parse and incoming request (up to the first double-newline)

◆ LWIP_HTTPD_MAX_REQ_LENGTH

#define LWIP_HTTPD_MAX_REQ_LENGTH   LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE))

Defines the maximum length of a HTTP request line (up to the first CRLF, copied from pbuf into this a global buffer when pbuf- or packet-queues are received - otherwise the input pbuf is used directly)

◆ LWIP_HTTPD_MAX_REQUEST_URI_LEN

#define LWIP_HTTPD_MAX_REQUEST_URI_LEN   63

This is the size of a static buffer used when URIs end with '/'. In this buffer, the directory requested is concatenated with all the configured default file names. Set to 0 to disable checking default filenames on non-root directories.

◆ LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN

#define LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN   63

Maximum length of the filename to send as response to a POST request, filled in by the application when a POST is finished.

◆ LWIP_HTTPD_SSI_INCLUDE_TAG

#define LWIP_HTTPD_SSI_INCLUDE_TAG   1

Set this to 0 to not send the SSI tag (default is on, so the tag will be sent in the HTML page

◆ LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR

#define LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR   0

Set this to 1 to call tcp_abort when tcp_close fails with memory error. This can be used to prevent consuming all memory in situations where the HTTP server has low priority compared to other communication.

◆ LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED

#define LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED   0

Set this to 1 to kill the oldest connection when running out of memory for 'struct http_state' or 'struct http_ssi_state'. ATTENTION: This puts all connections on a linked list, so may be kind of slow.

◆ LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI

#define LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI   0

Set this to 1 to send URIs without extension without headers

◆ HTTP_IS_TAG_VOLATILE

#define HTTP_IS_TAG_VOLATILE (   ptr)    TCP_WRITE_FLAG_COPY

Default: Tags are sent from struct http_state and are therefore volatile

◆ HTTPD_LIMIT_SENDING_TO_2MSS

#define HTTPD_LIMIT_SENDING_TO_2MSS   1

◆ HTTPD_MAX_WRITE_LEN

#define HTTPD_MAX_WRITE_LEN (   pcb)    (2 * tcp_mss(pcb))

◆ LWIP_HTTPD_CUSTOM_FILES

#define LWIP_HTTPD_CUSTOM_FILES   1

Set this to 1 and provide the functions:

  • "int fs_open_custom(struct fs_file *file, const char *name)" Called first for every opened file to allow opening files that are not included in fsdata(_custom).c
  • "void fs_close_custom(struct fs_file *file)" Called to free resources allocated by fs_open_custom().

◆ LWIP_HTTPD_DYNAMIC_FILE_READ

#define LWIP_HTTPD_DYNAMIC_FILE_READ   0

Set this to 1 to support fs_read() to dynamically read file data. Without this (default=off), only one-block files are supported, and the contents must be ready after fs_open().

◆ LWIP_HTTPD_FILE_STATE

#define LWIP_HTTPD_FILE_STATE   0

Set this to 1 to include an application state argument per file that is opened. This allows to keep a state per connection/file.

◆ HTTPD_PRECALCULATED_CHECKSUM

#define HTTPD_PRECALCULATED_CHECKSUM   0

HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for predefined (MSS-sized) chunks of the files to prevent having to calculate the checksums at runtime.

◆ LWIP_HTTPD_FS_ASYNC_READ

#define LWIP_HTTPD_FS_ASYNC_READ   0

LWIP_HTTPD_FS_ASYNC_READ==1: support asynchronous read operations (fs_read_async returns FS_READ_DELAYED and calls a callback when finished).

◆ HTTPD_USE_CUSTOM_FSDATA

#define HTTPD_USE_CUSTOM_FSDATA   0

Set this to 1 to include "fsdata_custom.c" instead of "fsdata.c" for the file system (to prevent changing the file included in CVS)