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.
Fork of lwip by
precomp/HTTPServer/HTTPLog.h@1:803fdc96fbd7, 2017-08-03 (annotated)
- Committer:
- idijoeteque
- Date:
- Thu Aug 03 10:24:16 2017 +0000
- Revision:
- 1:803fdc96fbd7
- Parent:
- 0:5e1631496985
hello
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| root@mbed.org | 0:5e1631496985 | 1 | #ifndef HTTPLOG_H |
| root@mbed.org | 0:5e1631496985 | 2 | #define HTTPLOG_H |
| root@mbed.org | 0:5e1631496985 | 3 | |
| root@mbed.org | 0:5e1631496985 | 4 | #include "HTTPServer.h" |
| root@mbed.org | 0:5e1631496985 | 5 | |
| root@mbed.org | 0:5e1631496985 | 6 | class HTTPLog : public HTTPHandler { |
| root@mbed.org | 0:5e1631496985 | 7 | public: |
| root@mbed.org | 0:5e1631496985 | 8 | HTTPLog(const char *prefix) : HTTPHandler(prefix) {} |
| root@mbed.org | 0:5e1631496985 | 9 | HTTPLog(HTTPServer *server, const char *prefix) : HTTPHandler(prefix) { server->addHandler(this); } |
| root@mbed.org | 0:5e1631496985 | 10 | |
| root@mbed.org | 0:5e1631496985 | 11 | private: |
| root@mbed.org | 0:5e1631496985 | 12 | virtual HTTPHandle action(HTTPConnection *con) const { |
| root@mbed.org | 0:5e1631496985 | 13 | struct ip_addr ip = con->pcb()->remote_ip; |
| root@mbed.org | 0:5e1631496985 | 14 | 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()); |
| root@mbed.org | 0:5e1631496985 | 15 | return HTTP_AddFields; |
| root@mbed.org | 0:5e1631496985 | 16 | } |
| root@mbed.org | 0:5e1631496985 | 17 | }; |
| root@mbed.org | 0:5e1631496985 | 18 | |
| root@mbed.org | 0:5e1631496985 | 19 | #endif |
