diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/crow/http_response.h | 6 | ||||
-rw-r--r-- | include/crow/http_server.h | 2 | ||||
-rw-r--r-- | include/crow/websocket.h | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/include/crow/http_response.h b/include/crow/http_response.h index f5e03b4..7940174 100644 --- a/include/crow/http_response.h +++ b/include/crow/http_response.h @@ -86,6 +86,12 @@ namespace crow completed_ = false; } + void redirect(const std::string& location) + { + code = 301; + set_header("Location", location); + } + void write(const std::string& body_part) { body += body_part; diff --git a/include/crow/http_server.h b/include/crow/http_server.h index 787fdb8..f190739 100644 --- a/include/crow/http_server.h +++ b/include/crow/http_server.h @@ -148,7 +148,7 @@ namespace crow }); } - CROW_LOG_INFO << server_name_ << " server is running on port " << port_ + CROW_LOG_INFO << server_name_ << " server is running at " << bindaddr_ <<":" << port_ << " using " << concurrency_ << " threads"; signals_.async_wait( diff --git a/include/crow/websocket.h b/include/crow/websocket.h index d21d7e9..c0e8c3f 100644 --- a/include/crow/websocket.h +++ b/include/crow/websocket.h @@ -226,7 +226,7 @@ namespace crow case WebSocketReadState::Len16: { remaining_length_ = 0; - uint16_t remaining_length16_ = 0; + uint16_t remaining_length16_ = 0; boost::asio::async_read(adaptor_.socket(), boost::asio::buffer(&remaining_length16_, 2), [this,&remaining_length16_](const boost::system::error_code& ec, std::size_t bytes_transferred) { |