shorten http logging a bit

pull/65/head
Thorsten von Eicken 9 years ago
parent d87468e3c7
commit f5b4177b8c
  1. 19
      httpd/httpd.c

@ -87,12 +87,16 @@ const char ICACHE_FLASH_ATTR *httpdGetMimetype(char *url) {
static char connStr[24];
static void debugConn(void *arg, char *what) {
#if 0
struct espconn *espconn = arg;
esp_tcp *tcp = espconn->proto.tcp;
os_sprintf(connStr, "%d.%d.%d.%d:%d ",
tcp->remote_ip[0], tcp->remote_ip[1], tcp->remote_ip[2], tcp->remote_ip[3],
tcp->remote_port);
//os_printf("%s %s\n", connStr, what);
#else
connStr[0] = 0;
#endif
}
//Looks up the connData info for a specific esp connection
@ -135,7 +139,8 @@ static void ICACHE_FLASH_ATTR httpdRetireConn(HttpdConnData *conn) {
uint32 dt = conn->startTime;
if (dt > 0) dt = (system_get_time() - dt) / 1000;
#ifdef HTTPD_DBG
os_printf("%s Closed, %ums, heap=%ld\n", connStr, dt,
os_printf("%sHTTP %s in %ums, heap=%ld\n", connStr,
conn->requestType == HTTPD_METHOD_GET ? "GET" : "POST", dt,
(unsigned long)system_get_free_heap_size());
#endif
}
@ -432,11 +437,19 @@ static void ICACHE_FLASH_ATTR httpdParseHeader(char *h, HttpdConnData *conn) {
*e = 0; //terminate url part
// Count number of open connections
#ifdef HTTPD_DBG
#if 0
int open = 0;
for (int j = 0; j<MAX_CONN; j++) if (connData[j].conn != NULL) open++;
#ifdef HTTPD_DBG
os_printf("%s%s %s (%d conn open)\n", connStr,
conn->requestType == HTTPD_METHOD_GET ? "GET" : "POST", conn->url, open);
#else
esp_tcp *tcp = conn->conn->proto.tcp;
os_printf("%sHTTP %s %s from %d.%d.%d.%d:%d\n", connStr,
conn->requestType == HTTPD_METHOD_GET ? "GET" : "POST", conn->url,
tcp->remote_ip[0], tcp->remote_ip[1], tcp->remote_ip[2], tcp->remote_ip[3],
tcp->remote_port);
#endif
#endif
//Parse out the URL part before the GET parameters.
conn->getArgs = (char*)os_strstr(conn->url, "?");
@ -444,7 +457,7 @@ static void ICACHE_FLASH_ATTR httpdParseHeader(char *h, HttpdConnData *conn) {
*conn->getArgs = 0;
conn->getArgs++;
#ifdef HTTPD_DBG
os_printf("%s args = %s\n", connStr, conn->getArgs);
//os_printf("%sargs = %s\n", connStr, conn->getArgs);
#endif
}
else {

Loading…
Cancel
Save