Skip to content

Commit d17d67b

Browse files
authored
Merge pull request #883 from evoskuil/master
Rename channel/protocol_websocket to _ws, drop ws handshake.
2 parents 8c7943b + 9d1f898 commit d17d67b

File tree

10 files changed

+32
-104
lines changed

10 files changed

+32
-104
lines changed

Makefile.am

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ include_bitcoin_node_channels_HEADERS = \
174174
include/bitcoin/node/channels/channel_http.hpp \
175175
include/bitcoin/node/channels/channel_peer.hpp \
176176
include/bitcoin/node/channels/channel_tcp.hpp \
177-
include/bitcoin/node/channels/channel_websocket.hpp \
177+
include/bitcoin/node/channels/channel_ws.hpp \
178178
include/bitcoin/node/channels/channels.hpp
179179

180180
include_bitcoin_node_chasersdir = ${includedir}/bitcoin/node/chasers
@@ -222,8 +222,7 @@ include_bitcoin_node_protocols_HEADERS = \
222222
include/bitcoin/node/protocols/protocol_transaction_in_106.hpp \
223223
include/bitcoin/node/protocols/protocol_transaction_out_106.hpp \
224224
include/bitcoin/node/protocols/protocol_web.hpp \
225-
include/bitcoin/node/protocols/protocol_websocket.hpp \
226-
include/bitcoin/node/protocols/protocol_websocket_shake.hpp \
225+
include/bitcoin/node/protocols/protocol_ws.hpp \
227226
include/bitcoin/node/protocols/protocols.hpp
228227

229228
include_bitcoin_node_sessionsdir = ${includedir}/bitcoin/node/sessions

builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
<ClInclude Include="..\..\..\..\include\bitcoin\node\channels\channel_http.hpp" />
171171
<ClInclude Include="..\..\..\..\include\bitcoin\node\channels\channel_peer.hpp" />
172172
<ClInclude Include="..\..\..\..\include\bitcoin\node\channels\channel_tcp.hpp" />
173-
<ClInclude Include="..\..\..\..\include\bitcoin\node\channels\channel_websocket.hpp" />
173+
<ClInclude Include="..\..\..\..\include\bitcoin\node\channels\channel_ws.hpp" />
174174
<ClInclude Include="..\..\..\..\include\bitcoin\node\channels\channels.hpp" />
175175
<ClInclude Include="..\..\..\..\include\bitcoin\node\chase.hpp" />
176176
<ClInclude Include="..\..\..\..\include\bitcoin\node\chasers\chaser.hpp" />
@@ -215,8 +215,7 @@
215215
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_transaction_in_106.hpp" />
216216
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_transaction_out_106.hpp" />
217217
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_web.hpp" />
218-
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_websocket.hpp" />
219-
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_websocket_shake.hpp" />
218+
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_ws.hpp" />
220219
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocols.hpp" />
221220
<ClInclude Include="..\..\..\..\include\bitcoin\node\sessions\session.hpp" />
222221
<ClInclude Include="..\..\..\..\include\bitcoin\node\sessions\session_inbound.hpp" />

builds/msvc/vs2022/libbitcoin-node/libbitcoin-node.vcxproj.filters

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
<ClInclude Include="..\..\..\..\include\bitcoin\node\channels\channel_tcp.hpp">
198198
<Filter>include\bitcoin\node\channels</Filter>
199199
</ClInclude>
200-
<ClInclude Include="..\..\..\..\include\bitcoin\node\channels\channel_websocket.hpp">
200+
<ClInclude Include="..\..\..\..\include\bitcoin\node\channels\channel_ws.hpp">
201201
<Filter>include\bitcoin\node\channels</Filter>
202202
</ClInclude>
203203
<ClInclude Include="..\..\..\..\include\bitcoin\node\channels\channels.hpp">
@@ -332,10 +332,7 @@
332332
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_web.hpp">
333333
<Filter>include\bitcoin\node\protocols</Filter>
334334
</ClInclude>
335-
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_websocket.hpp">
336-
<Filter>include\bitcoin\node\protocols</Filter>
337-
</ClInclude>
338-
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_websocket_shake.hpp">
335+
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocol_ws.hpp">
339336
<Filter>include\bitcoin\node\protocols</Filter>
340337
</ClInclude>
341338
<ClInclude Include="..\..\..\..\include\bitcoin\node\protocols\protocols.hpp">

include/bitcoin/node.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <bitcoin/node/channels/channel_http.hpp>
3232
#include <bitcoin/node/channels/channel_peer.hpp>
3333
#include <bitcoin/node/channels/channel_tcp.hpp>
34-
#include <bitcoin/node/channels/channel_websocket.hpp>
34+
#include <bitcoin/node/channels/channel_ws.hpp>
3535
#include <bitcoin/node/channels/channels.hpp>
3636
#include <bitcoin/node/chasers/chaser.hpp>
3737
#include <bitcoin/node/chasers/chaser_block.hpp>
@@ -69,8 +69,7 @@
6969
#include <bitcoin/node/protocols/protocol_transaction_in_106.hpp>
7070
#include <bitcoin/node/protocols/protocol_transaction_out_106.hpp>
7171
#include <bitcoin/node/protocols/protocol_web.hpp>
72-
#include <bitcoin/node/protocols/protocol_websocket.hpp>
73-
#include <bitcoin/node/protocols/protocol_websocket_shake.hpp>
72+
#include <bitcoin/node/protocols/protocol_ws.hpp>
7473
#include <bitcoin/node/protocols/protocols.hpp>
7574
#include <bitcoin/node/sessions/session.hpp>
7675
#include <bitcoin/node/sessions/session_inbound.hpp>

include/bitcoin/node/channels/channel_websocket.hpp renamed to include/bitcoin/node/channels/channel_ws.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* You should have received a copy of the GNU Affero General Public License
1717
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
19-
#ifndef LIBBITCOIN_NODE_CHANNELS_CHANNEL_WEBSOCKET_HPP
20-
#define LIBBITCOIN_NODE_CHANNELS_CHANNEL_WEBSOCKET_HPP
19+
#ifndef LIBBITCOIN_NODE_CHANNELS_CHANNEL_WS_HPP
20+
#define LIBBITCOIN_NODE_CHANNELS_CHANNEL_WS_HPP
2121

2222
#include <memory>
2323
#include <bitcoin/node/channels/channel.hpp>
@@ -29,19 +29,19 @@ namespace node {
2929

3030
/// Abstract base websocket channel state for the node.
3131
/// Does not inherit node::channel_http but does inherit network::channel_http.
32-
class BCN_API channel_websocket
33-
: public network::channel_websocket,
32+
class BCN_API channel_ws
33+
: public network::channel_ws,
3434
public node::channel
3535
{
3636
public:
37-
typedef std::shared_ptr<node::channel_websocket> ptr;
38-
using options_t = network::channel_websocket::options_t;
37+
typedef std::shared_ptr<node::channel_ws> ptr;
38+
using options_t = network::channel_ws::options_t;
3939

40-
channel_websocket(const network::logger& log,
40+
channel_ws(const network::logger& log,
4141
const network::socket::ptr& socket,
4242
const node::configuration& config, uint64_t identifier=zero,
4343
const options_t& options={}) NOEXCEPT
44-
: network::channel_websocket(log, socket, config.network, identifier,
44+
: network::channel_ws(log, socket, config.network, identifier,
4545
options),
4646
node::channel(log, socket, config, identifier)
4747
{

include/bitcoin/node/channels/channels.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <bitcoin/node/channels/channel_peer.hpp>
2424
#include <bitcoin/node/channels/channel_tcp.hpp>
2525
#include <bitcoin/node/channels/channel_http.hpp>
26-
#include <bitcoin/node/channels/channel_websocket.hpp>
26+
#include <bitcoin/node/channels/channel_ws.hpp>
2727

2828
#endif
2929

include/bitcoin/node/protocols/protocol_websocket_shake.hpp

Lines changed: 0 additions & 65 deletions
This file was deleted.

include/bitcoin/node/protocols/protocol_websocket.hpp renamed to include/bitcoin/node/protocols/protocol_ws.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* You should have received a copy of the GNU Affero General Public License
1717
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
19-
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_WEBSOCKET_HPP
20-
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_WEBSOCKET_HPP
19+
#ifndef LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_WS_HPP
20+
#define LIBBITCOIN_NODE_PROTOCOLS_PROTOCOL_WS_HPP
2121

2222
#include <memory>
2323
#include <bitcoin/node/define.hpp>
@@ -28,30 +28,30 @@ namespace node {
2828

2929
// TODO: make this an intermediate base class for websocket.
3030
// TODO: and then create a distinct concrete class for deployment.
31-
class BCN_API protocol_websocket
32-
: public network::protocol_websocket,
31+
class BCN_API protocol_ws
32+
: public network::protocol_ws,
3333
public node::protocol,
34-
protected network::tracker<protocol_websocket>
34+
protected network::tracker<protocol_ws>
3535
{
3636
public:
37-
typedef std::shared_ptr<protocol_websocket> ptr;
37+
typedef std::shared_ptr<protocol_ws> ptr;
3838

39-
// Replace base class channel_t (network::channel_websocket).
40-
using channel_t = node::channel_websocket;
39+
// Replace base class channel_t (network::channel_ws).
40+
using channel_t = node::channel_ws;
4141

42-
protocol_websocket(const auto& session,
42+
protocol_ws(const auto& session,
4343
const network::channel::ptr& channel,
4444
const options_t& options) NOEXCEPT
45-
: network::protocol_websocket(session, channel, options),
45+
: network::protocol_ws(session, channel, options),
4646
node::protocol(session, channel),
47-
network::tracker<protocol_websocket>(session->log)
47+
network::tracker<protocol_ws>(session->log)
4848
{
4949
}
5050

5151
/// Public start is required.
5252
void start() NOEXCEPT override
5353
{
54-
network::protocol_websocket::start();
54+
network::protocol_ws::start();
5555
}
5656

5757
private:

include/bitcoin/node/protocols/protocols.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@
4444
/// server
4545
#include <bitcoin/node/protocols/protocol_web.hpp>
4646
#include <bitcoin/node/protocols/protocol_explore.hpp>
47-
#include <bitcoin/node/protocols/protocol_websocket.hpp>
47+
#include <bitcoin/node/protocols/protocol_ws.hpp>
4848
#include <bitcoin/node/protocols/protocol_bitcoind.hpp>
4949
#include <bitcoin/node/protocols/protocol_electrum.hpp>
5050
#include <bitcoin/node/protocols/protocol_stratum_v1.hpp>
5151
#include <bitcoin/node/protocols/protocol_stratum_v2.hpp>
52-
#include <bitcoin/node/protocols/protocol_websocket.hpp>
53-
#include <bitcoin/node/protocols/protocol_websocket_shake.hpp>
52+
#include <bitcoin/node/protocols/protocol_ws.hpp>
5453

5554
#endif

include/bitcoin/node/sessions/sessions.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace node {
3333
// Alias server sessions derived from session_tcp.
3434
using session_web = session_server<protocol_web>;
3535
using session_explore = session_server<protocol_explore>;
36-
using session_websocket = session_server<protocol_websocket>;
36+
using session_websocket = session_server<protocol_ws>;
3737
using session_bitcoind = session_server<protocol_bitcoind>;
3838
using session_electrum = session_server<protocol_electrum>;
3939
using session_stratum_v1 = session_server<protocol_stratum_v1>;

0 commit comments

Comments
 (0)