Skip to content

Commit

Permalink
ssh/CConnection: rename OpenChannel() to CreateChannel()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jan 5, 2024
1 parent 357f114 commit 91b9d5b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions src/Connection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ class ResolveSocketChannelOperation final : Cancellable {
};

std::unique_ptr<SSH::Channel>
Connection::OpenChannel(std::string_view channel_type,
SSH::ChannelInit init,
std::span<const std::byte> payload,
CancellablePointer &cancel_ptr)
Connection::CreateChannel(std::string_view channel_type,
SSH::ChannelInit init,
std::span<const std::byte> payload,
CancellablePointer &cancel_ptr)
{
logger.Fmt(1, "ChannelOpen type={} local_channel={} peer_channel={}"sv,
channel_type, init.local_channel, init.peer_channel);
Expand Down Expand Up @@ -381,8 +381,8 @@ Connection::OpenChannel(std::string_view channel_type,
operation->Start(connect_host, connect_port, cancel_ptr);
return {};
} else
return SSH::CConnection::OpenChannel(channel_type, init, payload,
cancel_ptr);
return SSH::CConnection::CreateChannel(channel_type, init, payload,
cancel_ptr);
}

inline void
Expand Down
8 changes: 4 additions & 4 deletions src/Connection.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ private:
void OnAuthTimeout() noexcept;

/* virtual methods from class SSH::CConnection */
std::unique_ptr<SSH::Channel> OpenChannel(std::string_view channel_type,
SSH::ChannelInit init,
std::span<const std::byte> payload,
CancellablePointer &cancel_ptr) override;
std::unique_ptr<SSH::Channel> CreateChannel(std::string_view channel_type,
SSH::ChannelInit init,
std::span<const std::byte> payload,
CancellablePointer &cancel_ptr) override;

/* virtual methods from class SSH::Connection */
void HandlePacket(SSH::MessageNumber msg,
Expand Down
12 changes: 6 additions & 6 deletions src/ssh/CConnection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ CConnection::GetChannel(uint_least32_t local_channel)
#endif

std::unique_ptr<Channel>
CConnection::OpenChannel([[maybe_unused]] std::string_view channel_type,
[[maybe_unused]] ChannelInit init,
[[maybe_unused]] std::span<const std::byte> payload,
[[maybe_unused]] CancellablePointer &cancel_ptr)
CConnection::CreateChannel([[maybe_unused]] std::string_view channel_type,
[[maybe_unused]] ChannelInit init,
[[maybe_unused]] std::span<const std::byte> payload,
[[maybe_unused]] CancellablePointer &cancel_ptr)
{
throw ChannelOpenFailure{
ChannelOpenFailureReasonCode::UNKNOWN_CHANNEL_TYPE,
Expand Down Expand Up @@ -219,8 +219,8 @@ try {
auto *opening = new OpeningChannel(*this, init, 0);
channels[local_channel] = opening;

auto channel = OpenChannel(channel_type, init, payload,
opening->cancel_ptr);
auto channel = CreateChannel(channel_type, init, payload,
opening->cancel_ptr);
if (!channel) {
// asynchronous open (or already failed)
assert(channels[local_channel] == nullptr ||
Expand Down
12 changes: 6 additions & 6 deletions src/ssh/CConnection.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Channel;

/**
* Add SSH channel support to class #Connection. Override method
* OpenChannel().
* CreateChannel().
*/
class CConnection : public Connection
{
Expand All @@ -39,7 +39,7 @@ public:
void CloseChannel(Channel &channel);

/**
* Exception class to be thrown from inside OpenChannel(),
* Exception class to be thrown from inside CreateChannel(),
* caught by HandleChannelOpen().
*/
struct ChannelOpenFailure {
Expand Down Expand Up @@ -102,10 +102,10 @@ protected:
* is asynchronous; upon completion, call
* AsyncChannelOpenSuccess() or AsyncChannelOpenFailure())
*/
virtual std::unique_ptr<Channel> OpenChannel(std::string_view channel_type,
ChannelInit init,
std::span<const std::byte> payload,
CancellablePointer &cancel_ptr);
virtual std::unique_ptr<Channel> CreateChannel(std::string_view channel_type,
ChannelInit init,
std::span<const std::byte> payload,
CancellablePointer &cancel_ptr);

/* virtual methods from class SSH::Connection */
void HandlePacket(MessageNumber msg,
Expand Down

0 comments on commit 91b9d5b

Please sign in to comment.