MeterLogger
|
Go to the source code of this file.
Data Structures | |
struct | HttpdConnData |
struct | HttpdBuiltInUrl |
Macros | |
#define | HTTPDVER "0.2" |
#define | HTTPD_CGI_MORE 0 |
#define | HTTPD_CGI_DONE 1 |
#define | HTTPD_CGI_NOTFOUND 2 |
#define | HTTPD_CGI_AUTHENTICATED 2 |
Typedefs | |
typedef struct HttpdPriv | HttpdPriv |
typedef struct HttpdConnData | HttpdConnData |
typedef int(* | cgiSendCallback) (HttpdConnData *connData) |
Functions | |
ICACHE_FLASH_ATTR int | cgiRedirect (HttpdConnData *connData) |
ICACHE_FLASH_ATTR void | httpdRedirect (HttpdConnData *conn, char *newUrl) |
int | httpdUrlDecode (char *val, int valLen, char *ret, int retLen) |
ICACHE_FLASH_ATTR int | httpdFindArg (char *line, char *arg, char *buff, int buffLen) |
ICACHE_FLASH_ATTR void | httpdInit (HttpdBuiltInUrl *fixedUrls, int port) |
const char * | httpdGetMimetype (char *url) |
ICACHE_FLASH_ATTR void | httpdStartResponse (HttpdConnData *conn, int code) |
ICACHE_FLASH_ATTR void | httpdHeader (HttpdConnData *conn, const char *field, const char *val) |
ICACHE_FLASH_ATTR void | httpdEndHeaders (HttpdConnData *conn) |
ICACHE_FLASH_ATTR int | httpdGetHeader (HttpdConnData *conn, char *header, char *ret, int retLen) |
ICACHE_FLASH_ATTR int | httpdSend (HttpdConnData *conn, const char *data, int len) |
ICACHE_FLASH_ATTR void | httpdStop () |
#define HTTPD_CGI_AUTHENTICATED 2 |
Definition at line 11 of file httpd.h.
Referenced by authBasic().
#define HTTPD_CGI_DONE 1 |
Definition at line 9 of file httpd.h.
Referenced by authBasic(), cgiEspFsHook(), cgiEspFsTemplate(), cgiRedirect(), cgiSetup(), cgiWiFiScan(), cgiWifiSetMode(), httpdSendResp(), and httpdSentCb().
#define HTTPD_CGI_MORE 0 |
Definition at line 8 of file httpd.h.
Referenced by cgiEspFsHook(), and cgiEspFsTemplate().
#define HTTPD_CGI_NOTFOUND 2 |
Definition at line 10 of file httpd.h.
Referenced by cgiEspFsHook(), cgiEspFsTemplate(), and httpdSendResp().
#define HTTPDVER "0.2" |
Definition at line 6 of file httpd.h.
Referenced by httpdStartResponse().
typedef int(* cgiSendCallback) (HttpdConnData *connData) |
typedef struct HttpdConnData HttpdConnData |
ICACHE_FLASH_ATTR int cgiRedirect | ( | HttpdConnData * | connData | ) |
Definition at line 256 of file httpd.c.
References HttpdConnData::cgiArg, HttpdConnData::conn, HTTPD_CGI_DONE, httpdRedirect(), ICACHE_FLASH_ATTR, and NULL.
ICACHE_FLASH_ATTR void httpdEndHeaders | ( | HttpdConnData * | conn | ) |
Definition at line 240 of file httpd.c.
References httpdSend(), and ICACHE_FLASH_ATTR.
Referenced by authBasic(), cgiEspFsHook(), cgiEspFsTemplate(), and cgiWiFiScan().
ICACHE_FLASH_ATTR int httpdFindArg | ( | char * | line, |
char * | arg, | ||
char * | buff, | ||
int | buffLen | ||
) |
Definition at line 167 of file httpd.c.
References httpdUrlDecode(), ICACHE_FLASH_ATTR, INFO, NULL, os_strlen, os_strncmp, os_strstr, and strlen.
Referenced by cgiSetup(), and cgiWifiSetMode().
ICACHE_FLASH_ATTR int httpdGetHeader | ( | HttpdConnData * | conn, |
char * | header, | ||
char * | ret, | ||
int | retLen | ||
) |
Definition at line 189 of file httpd.c.
References HttpdPriv::head, HttpdPriv::headPos, ICACHE_FLASH_ATTR, os_strncmp, HttpdConnData::priv, and strlen.
Referenced by authBasic().
const char* httpdGetMimetype | ( | char * | url | ) |
Definition at line 93 of file httpd.c.
References ICACHE_FLASH_ATTR, MimeMap::mimetype, NULL, os_strcmp, and strlen.
Referenced by cgiEspFsHook(), and cgiEspFsTemplate().
ICACHE_FLASH_ATTR void httpdHeader | ( | HttpdConnData * | conn, |
const char * | field, | ||
const char * | val | ||
) |
Definition at line 229 of file httpd.c.
References httpdSend(), ICACHE_FLASH_ATTR, strlen, and tfp_snprintf().
Referenced by authBasic(), cgiEspFsHook(), cgiEspFsTemplate(), and cgiWiFiScan().
ICACHE_FLASH_ATTR void httpdInit | ( | HttpdBuiltInUrl * | fixedUrls, |
int | port | ||
) |
Definition at line 509 of file httpd.c.
References HttpdConnData::conn, espconn_accept(), ESPCONN_NONE, espconn_regist_connectcb(), ESPCONN_TCP, httpdConnectCb(), httpdTcp, ICACHE_FLASH_ATTR, INFO, _esp_tcp::local_port, malloc, MAX_CONN, NULL, espconn::proto, espconn::state, espconn::tcp, and espconn::type.
Referenced by httpd_user_init().
ICACHE_FLASH_ATTR void httpdRedirect | ( | HttpdConnData * | conn, |
char * | newUrl | ||
) |
Definition at line 246 of file httpd.c.
References httpdSend(), ICACHE_FLASH_ATTR, strlen, and tfp_snprintf().
Referenced by cgiRedirect(), cgiSetup(), and cgiWifiSetMode().
ICACHE_FLASH_ATTR int httpdSend | ( | HttpdConnData * | conn, |
const char * | data, | ||
int | len | ||
) |
Definition at line 270 of file httpd.c.
References ICACHE_FLASH_ATTR, MAX_SENDBUFF_LEN, os_memcpy, HttpdConnData::priv, HttpdPriv::sendBuff, HttpdPriv::sendBuffLen, and strlen.
Referenced by authBasic(), cgiEspFsTemplate(), cgiWiFiScan(), httpdEndHeaders(), httpdHeader(), httpdRedirect(), httpdSendResp(), httpdStartResponse(), and tplSetup().
ICACHE_FLASH_ATTR void httpdStartResponse | ( | HttpdConnData * | conn, |
int | code | ||
) |
Definition at line 219 of file httpd.c.
References httpdSend(), HTTPDVER, ICACHE_FLASH_ATTR, strlen, and tfp_snprintf().
Referenced by authBasic(), cgiEspFsHook(), cgiEspFsTemplate(), and cgiWiFiScan().
ICACHE_FLASH_ATTR void httpdStop | ( | ) |
Definition at line 534 of file httpd.c.
References espconn_delete(), espconn_disconnect(), ESPCONN_NONE, free, httpdDisconnectTimer, httpdDisconnectTimerFunc(), httpdRetireConn(), INFO, NULL, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, and espconn::state.
Referenced by httpdDisconnectTimerFunc().
int httpdUrlDecode | ( | char * | val, |
int | valLen, | ||
char * | ret, | ||
int | retLen | ||
) |
Definition at line 137 of file httpd.c.
References httpdHexVal(), and ICACHE_FLASH_ATTR.
Referenced by httpdFindArg().