| 640 | } |
| 641 | |
| 642 | void Server::SendHttpTimeout(struct mg_connection* connection, |
| 643 | const struct mg_request_info* request_info, |
| 644 | const std::string& body) { |
| 645 | LOG(TRACE) << "Entering Server::SendHttpTimeout"; |
| 646 | |
| 647 | std::ostringstream out; |
| 648 | out << "HTTP/1.1 408 Timeout\r\n\r\n" |
| 649 | << "Content-Length: " << strlen(body.c_str()) << "\r\n" |
| 650 | << "Content-Type: application/json; charset=utf-8\r\n" |
| 651 | << "Cache-Control: no-cache\r\n" |
| 652 | << "Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept\r\n" |
| 653 | << "Accept-Ranges: bytes\r\n\r\n"; |
| 654 | |
| 655 | mg_write(connection, out.str().c_str(), out.str().size()); |
| 656 | } |
| 657 | |
| 658 | void Server::SendHttpNotImplemented(struct mg_connection* connection, |
| 659 | const struct mg_request_info* request_info, |