Skip to content

Commit bbcbbfc

Browse files
committed
Style, comments.
1 parent 2531b49 commit bbcbbfc

File tree

10 files changed

+22
-12
lines changed

10 files changed

+22
-12
lines changed

include/bitcoin/protocol/web/utilities.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <windows.h>
2828
#endif
2929

30-
#include <boost/algorithm/string.hpp>
3130
#include <boost/filesystem.hpp>
3231
#include <bitcoin/system.hpp>
3332
#include <bitcoin/protocol/web/http.hpp>

include/bitcoin/protocol/web/websocket_frame.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ namespace http {
3333
class BCP_API websocket_frame
3434
{
3535
public:
36-
websocket_frame(const uint8_t* data, size_t size);
37-
3836
static system::data_chunk to_header(size_t length, websocket_op code);
3937

38+
websocket_frame(const uint8_t* data, size_t size);
39+
4040
operator bool() const;
4141
bool final() const;
4242
bool fragment() const;
@@ -50,7 +50,6 @@ class BCP_API websocket_frame
5050
private:
5151
void from_data(const uint8_t* data, size_t read_length);
5252

53-
private:
5453
static const size_t mask_ = 4;
5554

5655
bool valid_;

include/bitcoin/protocol/web/websocket_op.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ namespace libbitcoin {
2525
namespace protocol {
2626
namespace http {
2727

28-
enum class websocket_op : uint8_t
28+
enum class websocket_op: uint8_t
2929
{
3030
continuation = 0,
3131
text = 1,
3232
binary = 2,
3333
close = 8,
3434
ping = 9,
35-
pong = 10,
35+
pong = 10
3636
};
3737

3838
} // namespace http

include/bitcoin/protocol/web/websocket_transfer.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#define LIBBITCOIN_PROTOCOL_WEB_WEBSOCKET_TRANSFER_HPP
2121

2222
#include <cstddef>
23-
#include <cstdint>
2423
#include <bitcoin/system.hpp>
2524
#include <bitcoin/protocol/define.hpp>
2625

src/web/connection.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
#include <bitcoin/protocol/web/connection.hpp>
2020

21+
// TODO: include other headers.
22+
2123
namespace libbitcoin {
2224
namespace protocol {
2325
namespace http {
@@ -28,7 +30,7 @@ static constexpr size_t maximum_read_length = 1024;
2830
static constexpr size_t high_water_mark = 2 * 1024 * 1024;
2931

3032
connection::connection()
31-
: connection(0, sockaddr_in{})
33+
: connection(0, {})
3234
{
3335
}
3436

@@ -105,7 +107,7 @@ int32_t connection::read()
105107
#ifdef WITH_MBEDTLS
106108
bytes_read_ = (ssl_context_.enabled ?
107109
mbedtls_ssl_read(&ssl_context_.context, data, maximum_read_length) :
108-
recv(socket_, data, maximum_read_length, 0));
110+
recv(socket_, data, maximum_read_length, 0));
109111
#else
110112
bytes_read_ = recv(socket_, data, maximum_read_length, 0);
111113
#endif

src/web/json_string.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@
2222
// boost parsing helpers included from json_parser.hpp.
2323
// See: https://svn.boost.org/trac10/ticket/12621
2424
using namespace std::placeholders;
25+
2526
#include <boost/property_tree/json_parser.hpp>
2627
#include <boost/property_tree/ptree.hpp>
2728

29+
// TODO: include other headers.
30+
2831
namespace libbitcoin {
2932
namespace protocol {
3033
namespace http {

src/web/manager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
#include <bitcoin/protocol/web/manager.hpp>
2020

21+
// TODO: include other headers.
22+
2123
#ifdef WITH_MBEDTLS
2224
extern "C"
2325
{

src/web/socket.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
#include <bitcoin/protocol/web/socket.hpp>
2020

21+
// TODO: include other headers.
22+
2123
namespace libbitcoin {
2224
namespace protocol {
2325
namespace http {

src/web/utilities.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919
#include <bitcoin/protocol/web/utilities.hpp>
2020

21+
// TODO: include other headers.
22+
#include <boost/algorithm/string.hpp>
23+
2124
namespace libbitcoin {
2225
namespace protocol {
2326
namespace http {
@@ -91,8 +94,7 @@ std::string websocket_key_response(const std::string& websocket_key)
9194

9295
const auto input = websocket_key + rfc6455_guid;
9396
const data_chunk input_data(input.begin(), input.end());
94-
const data_slice slice(system::sha1_hash(input_data));
95-
return encode_base64(slice);
97+
return encode_base64(system::sha1_hash(input_data));
9698
}
9799

98100
bool is_json_request(const std::string& header_value)
@@ -115,7 +117,7 @@ bool parse_http(http_request& out, const std::string& request)
115117
if (position == std::string::npos)
116118
return false;
117119

118-
std::string method_line = request.substr(0, position);
120+
const auto method_line = request.substr(0, position);
119121
string_list elements;
120122
boost::split(elements, method_line, boost::is_any_of(" "));
121123
if (elements.size() != 3)

src/web/websocket_frame.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
#include <bitcoin/protocol/web/connection.hpp>
2020

21+
// TODO: include other headers.
22+
2123
namespace libbitcoin {
2224
namespace protocol {
2325
namespace http {

0 commit comments

Comments
 (0)