aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJaeseung Ha <ipknhama@gmail.com>2017-09-18 00:44:36 +0900
committerGitHub <noreply@github.com>2017-09-18 00:44:36 +0900
commit6da6579ce94a06f5389db62340b762fcb56f7c39 (patch)
tree77aa4aa0f2cbfd139dc3194a3cf113ed2100454f /include
parent194a9ef6812e3d5476419e33be2756ab69fc0696 (diff)
parent08acc7c0bedc24bf5b8c6cc01f1701b0d45e141e (diff)
downloadcrow-6da6579ce94a06f5389db62340b762fcb56f7c39.tar.gz
crow-6da6579ce94a06f5389db62340b762fcb56f7c39.zip
Merge pull request #171 from yorickdewid/master
Set cast type without dereferencing pointer
Diffstat (limited to 'include')
-rw-r--r--include/crow/http_response.h6
-rw-r--r--include/crow/http_server.h2
-rw-r--r--include/crow/websocket.h2
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)
{