Removed cout statements

This commit is contained in:
Caleb Herpin 2021-07-16 14:29:34 -05:00
parent d877eced88
commit b8fb6d747d
2 changed files with 1 additions and 6 deletions

View File

@ -371,10 +371,6 @@ void MyCivetServer::handleHTTPGETrequest(struct mg_connection *conn, const struc
httpMethodHandler handler = iter->second; httpMethodHandler handler = iter->second;
handler(conn, (void*)this); handler(conn, (void*)this);
} else { } else {
// mg_printf(conn,
// "HTTP/1.1 200 OK\r\nConnection: "
// "close\r\nTransfer-Encoding: chunked\r\n");
// mg_printf(conn, "Content-Type: text/plain\r\n\r\n");
std::stringstream ss; std::stringstream ss;
ss << "Error: http api " << handlerName << " is not implemented."; ss << "Error: http api " << handlerName << " is not implemented.";
http_send_ok(conn, ss.str().c_str(), ss.str().size(), 100); http_send_ok(conn, ss.str().c_str(), ss.str().size(), 100);

View File

@ -52,7 +52,6 @@ void http_send(struct mg_connection *conn, const char* msg, int len, int chunk_s
} }
while (size > 0) { while (size > 0) {
std::string buff = std::string(msg).substr(count * chunk_size, chunk_size); std::string buff = std::string(msg).substr(count * chunk_size, chunk_size);
std::cout << "Sending chunk: " << buff << std::endl;
mg_send_chunk(conn, buff.c_str(), buff.length()); mg_send_chunk(conn, buff.c_str(), buff.length());
count++; count++;
size = size - chunk_size; size = size - chunk_size;
@ -141,7 +140,7 @@ void echo_ready_handler(struct mg_connection *conn, void *cbdata)
int echo_data_handler(struct mg_connection *conn, int bits, int echo_data_handler(struct mg_connection *conn, int bits,
char *data, size_t data_len, void *cbdata) char *data, size_t data_len, void *cbdata)
{ {
std::cout << "from client:" << data << std::endl; message_publish(MSG_INFO, "Trick Webserver: websocket message from client:%s\n", data);
mg_websocket_write(conn, MG_WEBSOCKET_OPCODE_TEXT, data, strlen(data)); mg_websocket_write(conn, MG_WEBSOCKET_OPCODE_TEXT, data, strlen(data));
return 1; return 1;
} }