A simple web server that can be bound to either the EthernetInterface or the WiflyInterface.
Dependents: Smart-WiFly-WebServer WattEye X10Svr SSDP_Server
Diff: SW_HTTPServer.cpp
- Revision:
- 49:cd391662f254
- Parent:
- 48:078adbe279ac
- Child:
- 50:10db483f5154
--- a/SW_HTTPServer.cpp Sat Apr 08 19:39:51 2017 +0000 +++ b/SW_HTTPServer.cpp Sun Apr 09 18:39:37 2017 +0000 @@ -118,10 +118,11 @@ int _maxheaderParams, int _maxqueryParams, int _maxdynamicpages, + int blockingtime, PC * _pc, int _allocforheader, - int _allocforfile, - int blockingtime) + int _allocforfile + ) { webroot = (char *)malloc(strlen(_webroot)+1); strcpy(webroot, _webroot); @@ -151,8 +152,8 @@ server = new TCPSocketServer(); server->bind(port); server->listen(); - server->set_blocking(false, 10); - client.set_blocking(false, 10); //@TODO client is separate from server. any way to combine? + server->set_blocking(false, blockingtime); + client.set_blocking(false, blockingtime); //@TODO client is separate from server. any way to combine? ResetPerformanceData(); PerformanceTimer.start(); } @@ -240,7 +241,7 @@ t_ref = RecordPerformanceData(&perfData.ConnectionAccepted, t_ref); INFO("Accepted at %u", (unsigned int)PerformanceTimer.read_us()); } else { - INFO("Timeout waiting for accept()"); + //INFO("Timeout waiting for accept()"); } break; @@ -520,7 +521,7 @@ { char http[100]; - INFO("header(%d, %s, %s, ...)", code, code_text, content_type); + INFO("header(%d, %s, %s, %s)", code, code_text, content_type); snprintf(http, sizeof(http), "%s %i %s\r\n", hdr_httpver, code, code_text); send(http); if (content_type) {