Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: lwip/HTTPServer/HTTPLog.h
- Revision:
- 0:9cf1d79ebe04
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lwip/HTTPServer/HTTPLog.h Thu Sep 08 08:57:21 2011 +0000 @@ -0,0 +1,19 @@ +#ifndef HTTPLOG_H +#define HTTPLOG_H + +#include "HTTPServer.h" + +class HTTPLog : public HTTPHandler { + public: + HTTPLog(const char *prefix) : HTTPHandler(prefix) {} + HTTPLog(HTTPServer *server, const char *prefix) : HTTPHandler(prefix) { server->addHandler(this); } + + private: + virtual HTTPHandle action(HTTPConnection *con) const { + struct ip_addr ip = con->pcb()->remote_ip; + printf("%hhu.%hhu.%hhu.%hhu %s %s", (ip.addr)&0xFF, (ip.addr>>8)&0xFF, (ip.addr>>16)&0xFF, (ip.addr>>24)&0xFF, (con->getType() == POST? "POST" : "GET"), con->getURL()); + return HTTP_AddFields; + } +}; + +#endif