HttpServer Library for "mbed-os" which added a snapshot handler.
Dependents: GR-PEACH-webcam GR-Boards_WebCamera GR-Boards_WebCamera GR-Boards_WebCamera
Fork of HttpServer_snapshot by
Diff: HTTPRequestHandler.cpp
- Revision:
- 6:d9e6379eefac
- Parent:
- 4:1b6b021ee21d
- Child:
- 9:d117d5f84994
--- a/HTTPRequestHandler.cpp Sat Feb 22 05:51:59 2014 +0000 +++ b/HTTPRequestHandler.cpp Fri Aug 21 02:07:48 2015 +0000 @@ -145,9 +145,6 @@ void HTTPRequestHandler::readHeaders() { - static char line[128]; - static char key[128]; - static char value[128]; while( readLine(line, 128) > 0) { //if == 0, it is an empty line = end of headers int n = sscanf(line, "%[^:]: %[^\n]", key, value); if ( n == 2 ) { @@ -162,8 +159,6 @@ void HTTPRequestHandler::writeHeaders() //Called at the first writeData call { - static char line[128]; - //Response line sprintf(line, "HTTP/1.1 %d MbedInfo\r\n", m_errc); //Not a violation of the standard not to include the descriptive text m_pTCPSocketConnection->send(line, strlen(line)); @@ -187,7 +182,7 @@ int len = 0; for(int i = 0; i < maxLen - 1; i++) { ret = m_pTCPSocketConnection->receive(str, 1); - if(!ret) { + if(ret <= 0) { break; } if( (len > 1) && *(str-1)=='\r' && *str=='\n' ) {