Skip to content

Commit

Permalink
squash w/ startup/shutdown. Remove setRsCommFromRodsEnv.
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Nov 9, 2024
1 parent 9506ae8 commit ffe9ff5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
1 change: 0 additions & 1 deletion server/core/include/irods/initServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ int initHostConfigByFile();
int initRsComm(rsComm_t* rsComm);
int initRsCommWithStartupPack(rsComm_t* rsComm, startupPack_t* startupPack, bool& require_cs_neg);
int chkAllowedUser(const char* userName, const char* rodsZone);
int setRsCommFromRodsEnv(rsComm_t* rsComm);
void close_all_l1_descriptors(RsComm& _comm);

#endif // IRODS_INIT_SERVER_HPP
19 changes: 0 additions & 19 deletions server/core/src/initServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -933,25 +933,6 @@ chkAllowedUser( const char *userName, const char *rodsZone ) {
return 0;
}

int
setRsCommFromRodsEnv( rsComm_t *rsComm ) {
try {
const auto& zone_name = irods::get_server_property<const std::string>(irods::KW_CFG_ZONE_NAME);
const auto& zone_user = irods::get_server_property<const std::string>(irods::KW_CFG_ZONE_USER);

rstrcpy( rsComm->proxyUser.userName, zone_user.c_str(), NAME_LEN );
rstrcpy( rsComm->clientUser.userName, zone_user.c_str(), NAME_LEN );

rstrcpy( rsComm->proxyUser.rodsZone, zone_name.c_str(), NAME_LEN );
rstrcpy( rsComm->clientUser.rodsZone, zone_name.c_str(), NAME_LEN );
} catch ( const irods::exception& e ) {
irods::log( irods::error(e) );
return e.code();
}

return 0;
}

void close_all_l1_descriptors(RsComm& _comm)
{
log_agent::debug("[{}:{}] Closing all L1 descriptors ...", __func__, __LINE__);
Expand Down
16 changes: 13 additions & 3 deletions server/main_server/src/agent_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ auto main(int _argc, char* _argv[]) -> int

// Initialize zone information for request processing.
// 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); ec < 0) {
log_af::error("{}: initServerMain error. [error code={}]", __func__, ec);
Expand Down Expand Up @@ -636,8 +635,19 @@ namespace
return status;
}

// TODO This function's name does not match its behavior.
setRsCommFromRodsEnv(&_comm);
try {
const auto zone_name = irods::get_server_property<std::string>(irods::KW_CFG_ZONE_NAME);
const auto zone_user = irods::get_server_property<std::string>(irods::KW_CFG_ZONE_USER);

rstrcpy( _comm.proxyUser.userName, zone_user.c_str(), NAME_LEN );
rstrcpy( _comm.clientUser.userName, zone_user.c_str(), NAME_LEN );
rstrcpy( _comm.proxyUser.rodsZone, zone_name.c_str(), NAME_LEN );
rstrcpy( _comm.clientUser.rodsZone, zone_name.c_str(), NAME_LEN );
}
catch (const irods::exception& e) {
log_af::error("{}: Error initializing client and proxy user in RsComm from server configuration: {}", __func__, e.client_display_what());
return e.code();
}

int zone_port;
try {
Expand Down

0 comments on commit ffe9ff5

Please sign in to comment.