Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATL and EVPath Upstream #4238

Merged
merged 6 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions thirdparty/EVPath/EVPath/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#define FD_SETSIZE 1024
#include <winsock2.h>
#define __ANSI_CPP__
#define lrand48() rand()
#define srand48(x) srand((unsigned int)(x))
#else
#include <netinet/in.h>
#include <arpa/inet.h>
Expand Down Expand Up @@ -60,6 +62,7 @@ extern void libcmselect_LTX_select_stop(CMtrans_services svc,void *client_data);
static void CMinitialize (CManager cm);

static atom_t CM_TRANSPORT = -1;
static atom_t CM_CMANAGER_ID = -1;
static atom_t CM_NETWORK_POSTFIX = -1;
static atom_t CM_CONN_BLOCKING = -1;
atom_t CM_REBWM_RLEN = -1;
Expand Down Expand Up @@ -575,6 +578,7 @@ CMinternal_listen(CManager cm, attr_list listen_info, int try_others)
attrs = (*trans_list)->listen(cm, &CMstatic_trans_svcs,
*trans_list,
listen_info);
add_attr(attrs, CM_CMANAGER_ID, Attr_Int4, (intptr_t)cm->CManager_ID);
if (iface) {
add_string_attr(attrs, CM_IP_INTERFACE, strdup(iface));
}
Expand Down Expand Up @@ -752,6 +756,7 @@ INT_CManager_create_control(char *control_module)

if (atom_init == 0) {
CM_TRANSPORT = attr_atom_from_string("CM_TRANSPORT");
CM_CMANAGER_ID = attr_atom_from_string("CM_CMANAGER_ID");
CM_NETWORK_POSTFIX = attr_atom_from_string("CM_NETWORK_POSTFIX");
CM_CONN_BLOCKING = attr_atom_from_string("CM_CONN_BLOCKING");
CM_REBWM_RLEN = attr_atom_from_string("CM_REG_BW_RUN_LEN");
Expand All @@ -772,6 +777,9 @@ INT_CManager_create_control(char *control_module)
cm->transports = NULL;
cm->initialized = 0;
cm->reference_count = 1;
uint64_t seed = getpid() + time(NULL);
srand48(seed);
cm->CManager_ID = (int)lrand48();

char *tmp;
if ((tmp = getenv("CMControlModule"))) {
Expand Down Expand Up @@ -1490,7 +1498,7 @@ INT_CMget_ip_config_diagnostics(CManager cm)
msg[0] = 0x434d4800; /* CMH\0 */
msg[1] = (CURRENT_HANDSHAKE_VERSION << 24) + sizeof(msg);
msg[2] = cm->FFSserver_identifier;
msg[3] = 5; /* not implemented yet */
msg[3] = cm->CManager_ID;
msg[4] = 0; /* not implemented yet */
if (conn->remote_format_server_ID != 0) {
/* set high bit if we already have his ID */
Expand Down Expand Up @@ -1691,12 +1699,16 @@ timeout_conn(CManager cm, void *client_data)
fprintf(cm->CMTrace_file, "In CMinternal_get_conn, attrs ");
if (attrs) fdump_attr_list(cm->CMTrace_file, attrs); else fprintf(cm->CMTrace_file, "\n");
}
int target_cm_id = -1;
(void) get_int_attr(attrs, CM_CMANAGER_ID, &target_cm_id);
for (i=0; i<cm->connection_count; i++) {
CMConnection tmp = cm->connections[i];
if (tmp->closed || tmp->failed) continue;
if (tmp->trans->connection_eq(cm, &CMstatic_trans_svcs,
tmp->trans, attrs,
tmp->transport_data)) {

if ((tmp->remote_CManager_ID == target_cm_id) ||
tmp->trans->connection_eq(cm, &CMstatic_trans_svcs,
tmp->trans, attrs,
tmp->transport_data)) {

CMtrace_out(tmp->cm, CMFreeVerbose, "internal_get_conn found conn=%p ref count will be %d\n",
tmp, tmp->conn_ref_count +1);
Expand Down
1 change: 1 addition & 0 deletions thirdparty/EVPath/EVPath/cm_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ typedef struct _CManager {
int initialized;
int reference_count;
char *control_module_choice; /* this is static, doesn't need to be free'd */
int CManager_ID;

CMControlList control_list; /* the control list for this DE */

Expand Down
1 change: 1 addition & 0 deletions thirdparty/atl/atl/atom.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ static void nt_socket_init_func(){}


static char *in_use_values[] = {
"CM_CMANAGER_ID",
"CM_BW_MEASURED_COF",
"CM_BW_MEASURED_VALUE",
"CM_BW_MEASURE_INTERVAL",
Expand Down
Loading