регион HTTPD_STATE

HTTPD_STATE это регион памяти , в котором создаются блоки памяти для каждого вновь созданного http соединения.


struct http_state
{
#if LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED
	struct http_state *next;
#endif // LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 

	struct fs_file file_handle;

	struct fs_file *handle;

	char *file; /* Pointer to first unsent byte in buf. */

	HTTP_CONTENT_TYPE contentType;

	struct tcp_pcb *pcb;

#if LWIP_HTTPD_SUPPORT_REQUESTLIST

	struct pbuf *req;

#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */

#if LWIP_HTTPD_DYNAMIC_FILE_READ
	char *buf; /* File read buffer. */
	int buf_len; /* Size of file read buffer, buf. */
#endif /* LWIP_HTTPD_DYNAMIC_FILE_READ */

	u32_t left; /* Number of unsent bytes in buf. */
	u8_t retries;

#if LWIP_HTTPD_SUPPORT_11_KEEPALIVE
	u8_t keepalive;
#endif /* LWIP_HTTPD_SUPPORT_11_KEEPALIVE */
#if LWIP_HTTPD_SSI

	struct http_ssi_state *ssi;

#endif /* LWIP_HTTPD_SSI */
#if LWIP_HTTPD_CGI

	char *params [ LWIP_HTTPD_MAX_CGI_PARAMETERS ]; /* Params extracted from the request URI */
	char *param_vals [ LWIP_HTTPD_MAX_CGI_PARAMETERS ]; /* Values for each extracted param */

#endif /* LWIP_HTTPD_CGI */
#if LWIP_HTTPD_DYNAMIC_HEADERS
	const char *hdrs[NUM_FILE_HDR_STRINGS]; /* HTTP headers to be sent. */
	u16_t hdr_pos; /* The position of the first unsent header byte in the
	 current string */
	u16_t hdr_index; /* The index of the hdr string currently being sent. */
#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */
#if LWIP_HTTPD_TIMING
	u32_t time_started;
#endif /* LWIP_HTTPD_TIMING */

#if LWIP_HTTPD_SUPPORT_POST
	u32_t post_content_len_left;
#if LWIP_HTTPD_POST_MANUAL_WND
	u32_t unrecved_bytes;
	u8_t no_auto_wnd;
	u8_t post_finished;
#endif /* LWIP_HTTPD_POST_MANUAL_WND */
#endif /* LWIP_HTTPD_SUPPORT_POST*/
};

Тут учитывается количество принятых данных, а точнее количество оставшихся к приему байт post_content_len_left. Это используется для приема посылки состоящей из многих сегментов TCP и многих окон TCP.