Skip to content

Commit

Permalink
squash. Small tweaks to agent factory impl.
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Oct 30, 2024
1 parent 0ca3683 commit 5f0077f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions server/main_server/src/agent_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ namespace
auto deinit_shared_memory_for_plugins() -> irods::error;

// TODO Refactor these functions.
#if 0
auto initServer(RsComm& _comm) -> int;
auto initServerMain(RsComm& _comm, const bool _enable_test_mode, const bool _write_to_stdout) -> int;
#endif
auto initServerMain(RsComm& _comm) -> int;

auto handle_client_request(int _socket_fd, std::time_t _created_at) -> int;
auto cleanup() -> void;
Expand Down Expand Up @@ -274,7 +276,7 @@ auto main(int _argc, char* _argv[]) -> int
// initServerMain starts the listening socket and stores it in svrComm.
// TODO initServerMain can likely be simplified.
RsComm svrComm{}; // RsComm contains a std::string, so never use memset() on this type!
if (const auto ec = initServerMain(svrComm, false, false); ec < 0) {
if (const auto ec = initServerMain(svrComm); ec < 0) {
log_af::error("{}: initServerMain error. [error code={}]", __func__, ec);
return 1;
}
Expand Down Expand Up @@ -640,6 +642,8 @@ namespace
return SUCCESS();
} // deinit_shared_memory_for_plugins

// TODO Remove this since initAgent() covers this for agents.
#if 0
auto initServer(RsComm& _comm) -> int
{
if (const auto ec = initServerInfo(0, &_comm); ec < 0) {
Expand Down Expand Up @@ -675,10 +679,9 @@ namespace

return 0;
} // initServer
#endif

auto initServerMain(RsComm& _comm,
const bool enable_test_mode = false,
const bool write_to_stdout = false) -> int
auto initServerMain(RsComm& _comm) -> int
{
std::memset(&_comm, 0, sizeof(RsComm));
int status = getRodsEnv(&_comm.myEnv);
Expand Down Expand Up @@ -724,7 +727,7 @@ namespace
zone_port = irods::get_server_property<const int>(irods::KW_CFG_ZONE_PORT);
}
catch (const irods::exception& e) {
irods::log(irods::error(e));
log_af::error("{}: Could not retrieve property from server configuration: [{}]", __func__, irods::KW_CFG_ZONE_PORT);
return e.code();
}

Expand Down

0 comments on commit 5f0077f

Please sign in to comment.