Simple HTTP Server with one page index.html stored inside MBED as char vector and javascript to update a table content
Fork of HTTP_SERVER by
Diff: handlers/ResponseMessenger.cpp
- Revision:
- 11:0ee7d100db24
- Parent:
- 10:4a48594c2f44
--- a/handlers/ResponseMessenger.cpp Thu Dec 08 05:56:53 2016 +0000 +++ b/handlers/ResponseMessenger.cpp Thu Dec 08 10:10:43 2016 +0000 @@ -41,7 +41,7 @@ int ResponseMessenger::setHeaderField( const char* arg_field_name, const char* arg_field_val) { - const int nField = 4; + const int nField = 7; char registered_field_name[nField][32]= { "Connection", "Location", @@ -62,7 +62,7 @@ if(flag) { sprintf(header_field_line_buffer, "%s: %s\r\n", arg_field_name, arg_field_val); strcat(header_field_buffer, header_field_line_buffer); - printf("(RM) header field: \r\n%s\r\n", header_field_buffer); + //printf("(RM) header field: \r\n%s\r\n", header_field_buffer); } // To be safe on the sage side header_field_buffer[HEADER_FIELDS_SIZE - 1] = '\0'; @@ -91,7 +91,7 @@ if(flag) { sprintf(header_field_line_buffer, "%s: %d\r\n", arg_field_name, arg_field_val); strcat(header_field_buffer, header_field_line_buffer); - printf("(RM) header field: \r\n%s\r\n", header_field_buffer); + //printf("(RM) header field: \r\n%s\r\n", header_field_buffer); } // To be safe on the sage side header_field_buffer[HEADER_FIELDS_SIZE - 1] = '\0'; @@ -190,8 +190,8 @@ err_log = arg_connection.send_all((char*)buffer, i); //printf("(RM) buffer log: %s", buffer); } - if (arg_file.hasError()) printf("(RM) \r\n[ERR][ERR][ERR]\r\n"); - if (arg_file.atEOF()) printf("(RM) \r\n[EOF][EOF][EOF]\r\n"); + if (arg_file.hasError()) printf("(RM)---[ERR]---\r\n"); + if (arg_file.atEOF()) printf("(RM)---[EOF]---\r\n"); } while (!arg_file.atEOF() && !arg_file.hasError()); printf("(RM) [Body has sent]\r\n");