au wot hackathon0314 test program
Dependencies: NySNICInterface mbed-rtos mbed
Fork of RESTServer_team4 by
Diff: HTTPServer.cpp
- Revision:
- 1:e821c773d5f0
- Parent:
- 0:998e2e00df0c
- Child:
- 2:2f187e09bdb0
--- a/HTTPServer.cpp Tue Feb 10 12:15:47 2015 +0000 +++ b/HTTPServer.cpp Sun Feb 15 00:18:07 2015 +0000 @@ -1,6 +1,8 @@ #include "HTTPServer.h" #include "mbed.h" +#include "parse_request.h" + bool cmp(char* a, char* b) { @@ -52,10 +54,11 @@ { while(socketserver.accept(&c)); c.set_blocking(false, 1000); - + while(c.is_connected()) { int n = c.receive(buffer, sizeof(buffer)-1); + if(n == 0) { c.close(); @@ -91,6 +94,14 @@ reply[0] = '\0'; response_code = HTTP_404_NOTFOUND; +// 追加 20150214 + printf("%s\n",request); + + parse_request(request); + + +/* + if(!object.decode(request, reply)){ return; } @@ -105,6 +116,7 @@ response_code = itor->second->handle(object, reply); else printf("Invalid request handler\r\n"); +*/ }