Skip to content

Commit

Permalink
core: inline socket_factory::create()
Browse files Browse the repository at this point in the history
  • Loading branch information
deniskovalchuk committed Apr 7, 2024
1 parent a64086f commit 54ddda2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 84 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ set(sources
include/ftp/detail/net_utils.hpp
include/ftp/detail/socket.hpp
include/ftp/detail/socket_base.hpp
include/ftp/detail/socket_factory.hpp
include/ftp/detail/ssl_socket.hpp
include/ftp/detail/utils.hpp
include/ftp/stream/input_stream.hpp
Expand Down Expand Up @@ -59,7 +58,6 @@ set(sources
src/replies.cpp
src/reply.cpp
src/socket.cpp
src/socket_factory.cpp
src/ssl_socket.cpp
src/utils.cpp)

Expand Down
41 changes: 0 additions & 41 deletions include/ftp/detail/socket_factory.hpp

This file was deleted.

3 changes: 1 addition & 2 deletions src/control_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include <ftp/ftp_exception.hpp>
#include <ftp/detail/control_connection.hpp>
#include <ftp/detail/socket_factory.hpp>
#include <ftp/detail/socket.hpp>
#include <ftp/detail/ssl_socket.hpp>
#include <ftp/detail/utils.hpp>
Expand All @@ -44,7 +43,7 @@ static bool try_parse_status_code(std::string_view line, std::uint16_t & status_

control_connection::control_connection(net_context & net_context)
{
socket_ = socket_factory::create(net_context.get_io_context());
socket_ = std::make_unique<socket>(net_context.get_io_context());
}

void control_connection::connect(std::string_view hostname, std::uint16_t port)
Expand Down
4 changes: 2 additions & 2 deletions src/data_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

#include <ftp/detail/data_connection.hpp>
#include <ftp/detail/socket_factory.hpp>
#include <ftp/detail/socket.hpp>
#include <ftp/ftp_exception.hpp>
#include <array>

Expand All @@ -33,7 +33,7 @@ namespace ftp::detail
data_connection::data_connection(net_context & net_context)
: acceptor_(net_context.get_io_context())
{
socket_ = socket_factory::create(net_context.get_io_context());
socket_ = std::make_unique<socket>(net_context.get_io_context());
}

void data_connection::connect(std::string_view ip, std::uint16_t port)
Expand Down
37 changes: 0 additions & 37 deletions src/socket_factory.cpp

This file was deleted.

0 comments on commit 54ddda2

Please sign in to comment.