diff options
Diffstat (limited to 'crow')
-rw-r--r-- | crow/include/crow/http_response.h | 8 | ||||
-rw-r--r-- | crow/include/crow/http_server.h | 1 | ||||
-rw-r--r-- | crow/include/crow/websocket.h | 5 |
3 files changed, 9 insertions, 5 deletions
diff --git a/crow/include/crow/http_response.h b/crow/include/crow/http_response.h index c81446fb3d..07493bc3bf 100644 --- a/crow/include/crow/http_response.h +++ b/crow/include/crow/http_response.h @@ -47,18 +47,18 @@ struct response { } response(response&& r) { - CROW_LOG_WARNING << "Moving response containers"; + CROW_LOG_DEBUG << "Moving response containers"; *this = std::move(r); } ~response(){ - CROW_LOG_WARNING << "Destroying response"; + CROW_LOG_DEBUG << "Destroying response"; } response& operator=(const response& r) = delete; response& operator=(response&& r) noexcept { - CROW_LOG_WARNING << "Moving response containers"; + CROW_LOG_DEBUG << "Moving response containers"; body = std::move(r.body); json_value = std::move(r.json_value); code = r.code; @@ -70,7 +70,7 @@ struct response { bool is_completed() const noexcept { return completed_; } void clear() { - CROW_LOG_WARNING << "Clearing response containers"; + CROW_LOG_DEBUG << "Clearing response containers"; body.clear(); json_value.clear(); code = 200; diff --git a/crow/include/crow/http_server.h b/crow/include/crow/http_server.h index 2ead557a73..5ed2927635 100644 --- a/crow/include/crow/http_server.h +++ b/crow/include/crow/http_server.h @@ -113,7 +113,6 @@ class Server { timer.async_wait(handler); }; timer.async_wait(handler); - CROW_LOG_INFO << init_count; init_count++; try { io_service_pool_[i]->run(); diff --git a/crow/include/crow/websocket.h b/crow/include/crow/websocket.h index f29f13be1e..65a5836a36 100644 --- a/crow/include/crow/websocket.h +++ b/crow/include/crow/websocket.h @@ -18,6 +18,7 @@ struct connection { virtual void send_binary(const std::string& msg) = 0; virtual void send_text(const std::string& msg) = 0; virtual void close(const std::string& msg = "quit") = 0; + virtual boost::asio::io_service& get_io_service() = 0; virtual ~connection() {} void userdata(void* u) { userdata_ = u; } @@ -70,6 +71,10 @@ class Connection : public connection { adaptor_.get_io_service().post(handler); } + boost::asio::io_service& get_io_service(){ + return adaptor_.get_io_service(); + } + void send_pong(const std::string& msg) { dispatch([this, msg] { char buf[3] = "\x8A\x00"; |