From 2f64f8d91ab0f5987fed1ca8d715b61f20dcfa6b Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Mon, 6 Oct 2014 19:04:04 -0400 Subject: [PATCH] adds documentation and removes unused parameters references #376 --- .../permessage_deflate/disabled.hpp | 33 ++++++++---- websocketpp/message_buffer/alloc.hpp | 2 +- websocketpp/transport/asio/connection.hpp | 51 +++++++++++++++---- websocketpp/transport/iostream/connection.hpp | 2 +- websocketpp/transport/iostream/endpoint.hpp | 2 +- 5 files changed, 69 insertions(+), 21 deletions(-) diff --git a/websocketpp/extensions/permessage_deflate/disabled.hpp b/websocketpp/extensions/permessage_deflate/disabled.hpp index 3a5da7fdcc..7950c4db5a 100644 --- a/websocketpp/extensions/permessage_deflate/disabled.hpp +++ b/websocketpp/extensions/permessage_deflate/disabled.hpp @@ -53,7 +53,15 @@ class disabled { typedef std::pair err_str_pair; public: - err_str_pair negotiate(http::attribute_list const & attributes) { + /// Negotiate extension + /** + * The disabled extension always fails the negotiation with a disabled + * error. + * + * @param offer Attribute from client's offer + * @return Status code and value to return to remote endpoint + */ + err_str_pair negotiate(http::attribute_list const &) { return make_pair(make_error_code(error::disabled),std::string()); } @@ -69,17 +77,24 @@ public: return false; } - lib::error_code compress(std::string const & in, std::string & out) { + /// Compress bytes + /** + * @param [in] in String to compress + * @param [out] out String to append compressed bytes to + * @return Error or status code + */ + lib::error_code compress(std::string const &, std::string &) { return make_error_code(error::disabled); } - lib::error_code decompress(uint8_t const * buf, size_t len, - std::string & out) - { - return make_error_code(error::disabled); - } - - lib::error_code decompress(std::string const & in, std::string & out) { + /// Decompress bytes + /** + * @param buf Byte buffer to decompress + * @param len Length of buf + * @param out String to append decompressed bytes to + * @return Error or status code + */ + lib::error_code decompress(uint8_t const *, size_t, std::string &) { return make_error_code(error::disabled); } }; diff --git a/websocketpp/message_buffer/alloc.hpp b/websocketpp/message_buffer/alloc.hpp index 5ac0ed433e..fc6ab98061 100644 --- a/websocketpp/message_buffer/alloc.hpp +++ b/websocketpp/message_buffer/alloc.hpp @@ -77,7 +77,7 @@ public: * * @return true if the message was successfully recycled, false otherwse. */ - bool recycle(message * msg) { + bool recycle(message *) { return false; } }; diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp index 908c47961a..a086e7058d 100644 --- a/websocketpp/transport/asio/connection.hpp +++ b/websocketpp/transport/asio/connection.hpp @@ -323,11 +323,11 @@ public: * * TODO: candidate for protected status * - * @param t Pointer to the timer in question + * @param post_timer Pointer to the timer in question * @param callback The function to call back * @param ec The status code */ - void handle_timer(timer_ptr t, timer_handler callback, + void handle_timer(timer_ptr, timer_handler callback, boost::system::error_code const & ec) { if (ec) { @@ -502,7 +502,16 @@ protected: ); } - void handle_post_init_timeout(timer_ptr post_timer, init_handler callback, + /// Post init timeout callback + /** + * The timer pointer is included to ensure the timer isn't destroyed until + * after it has expired. + * + * @param post_timer Pointer to the timer in question + * @param callback The function to call back + * @param ec The status code + */ + void handle_post_init_timeout(timer_ptr, init_handler callback, lib::error_code const & ec) { lib::error_code ret_ec; @@ -529,6 +538,15 @@ protected: callback(ret_ec); } + /// Post init timeout callback + /** + * The timer pointer is included to ensure the timer isn't destroyed until + * after it has expired. + * + * @param post_timer Pointer to the timer in question + * @param callback The function to call back + * @param ec The status code + */ void handle_post_init(timer_ptr post_timer, init_handler callback, lib::error_code const & ec) { @@ -693,8 +711,14 @@ protected: } } + /// Proxy read callback + /** + * @param init_handler The function to call back + * @param ec The status code + * @param bytes_transferred The number of bytes read + */ void handle_proxy_read(init_handler callback, - boost::system::error_code const & ec, size_t bytes_transferred) + boost::system::error_code const & ec, size_t) { if (m_alog.static_test(log::alevel::devel)) { m_alog.write(log::alevel::devel, @@ -901,9 +925,12 @@ protected: ); } - void handle_async_write(boost::system::error_code const & ec, - size_t bytes_transferred) - { + /// Async write callback + /** + * @param ec The status code + * @param bytes_transferred The number of bytes read + */ + void handle_async_write(boost::system::error_code const & ec, size_t) { m_bufs.clear(); lib::error_code tec; if (ec) { @@ -999,8 +1026,14 @@ protected: ); } - void handle_async_shutdown_timeout(timer_ptr shutdown_timer, init_handler - callback, lib::error_code const & ec) + /// Async shutdown timeout handler + /** + * @param shutdown_timer A pointer to the timer to keep it in scope + * @param callback The function to call back + * @param ec The status code + */ + void handle_async_shutdown_timeout(timer_ptr, init_handler callback, + lib::error_code const & ec) { lib::error_code ret_ec; diff --git a/websocketpp/transport/iostream/connection.hpp b/websocketpp/transport/iostream/connection.hpp index e821863525..6e61560a7c 100644 --- a/websocketpp/transport/iostream/connection.hpp +++ b/websocketpp/transport/iostream/connection.hpp @@ -304,7 +304,7 @@ public: * @return A handle that can be used to cancel the timer if it is no longer * needed. */ - timer_ptr set_timer(long duration, timer_handler handler) { + timer_ptr set_timer(long, timer_handler) { return timer_ptr(); } protected: diff --git a/websocketpp/transport/iostream/endpoint.hpp b/websocketpp/transport/iostream/endpoint.hpp index ff37866d90..92545a7c1b 100644 --- a/websocketpp/transport/iostream/endpoint.hpp +++ b/websocketpp/transport/iostream/endpoint.hpp @@ -140,7 +140,7 @@ protected: * @param u A URI pointer to the URI to connect to. * @param cb The function to call back with the results when complete. */ - void async_connect(transport_con_ptr tcon, uri_ptr u, connect_handler cb) { + void async_connect(transport_con_ptr, uri_ptr, connect_handler cb) { cb(lib::error_code()); }