Loading thirdparty/EVPath/EVPath/CMakeLists.txt +4 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,10 @@ endif() # udt4 transport set(RUN_UDT4_TESTS FALSE) if(NOT(DEFINED EVPATH_USE_UDT4)) #UDT4 not particularly functional, default to not building set(EVPATH_USE_UDT4 FALSE) endif() if(DEFINED EVPATH_USE_UDT4) option(EVPATH_USE_UDT4 "Build the udt4 transport" "${EVPATH_USE_UDT4}") if(EVPATH_USE_UDT4) Loading thirdparty/EVPath/EVPath/cm.c +7 −7 Original line number Diff line number Diff line Loading @@ -3677,12 +3677,12 @@ typedef struct foreign_handler_struct { static handler_list foreign_handler_list; static int foreign_handler_count = 0; static void clear_foreign_handlers() { if (foreign_handler_count == 0) return; free(foreign_handler_list); } /* static void */ /* clear_foreign_handlers() */ /* { */ /* if (foreign_handler_count == 0) return; */ /* free(foreign_handler_list); */ /* } */ extern void INT_CMregister_non_CM_message_handler(int header, CMNonCMHandler handler) Loading @@ -3693,7 +3693,7 @@ clear_foreign_handlers() (foreign_handler_count + 1)); } else { foreign_handler_list = INT_CMmalloc(sizeof(foreign_handler_list[0])); atexit(clear_foreign_handlers); /* atexit(clear_foreign_handlers);*/ } foreign_handler_list[foreign_handler_count].header = header; foreign_handler_list[foreign_handler_count].handler = handler; Loading thirdparty/EVPath/EVPath/cm_transport.c +25 −25 Original line number Diff line number Diff line Loading @@ -28,30 +28,30 @@ extern struct CMtrans_services_s CMstatic_trans_svcs; static transport_entry *global_transports = NULL; static void free_global_transports() { int i = 0; transport_entry *tmp; if (global_transports == NULL) { return; } else { tmp = global_transports; global_transports = NULL; } while (tmp[i]) { #if !NO_DYNAMIC_LINKING CMdlclose(tmp[i]->dlhandle); #endif free(tmp[i]->trans_name); free(tmp[i]); i++; } free(tmp); #if !NO_DYNAMIC_LINKING CMdlclearsearchlist(); #endif } /* static void */ /* free_global_transports() */ /* { */ /* int i = 0; */ /* transport_entry *tmp; */ /* if (global_transports == NULL) { */ /* return; */ /* } else { */ /* tmp = global_transports; */ /* global_transports = NULL; */ /* } */ /* while (tmp[i]) { */ /* #if !NO_DYNAMIC_LINKING */ /* CMdlclose(tmp[i]->dlhandle); */ /* #endif */ /* free(tmp[i]->trans_name); */ /* free(tmp[i]); */ /* i++; */ /* } */ /* free(tmp); */ /* #if !NO_DYNAMIC_LINKING */ /* CMdlclearsearchlist(); */ /* #endif */ /* } */ int find_transport_in_cm(CManager cm, const char *trans_name) Loading Loading @@ -293,7 +293,7 @@ load_transport(CManager cm, const char *trans_name, int quiet) } else { global_transports = INT_CMmalloc(sizeof(global_transports) * (i + 2)); atexit(free_global_transports); /* atexit(free_global_transports);*/ } global_transports[i] = transport; global_transports[i + 1] = NULL; Loading thirdparty/EVPath/EVPath/cmenet.c +62 −35 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #include <string.h> #include <stdio.h> #include <limits.h> #include <pthread.h> #include <enet/enet.h> #include <arpa/inet.h> Loading Loading @@ -432,7 +433,6 @@ initiate_conn(CManager cm, CMtrans_services svc, transport_entry trans, peer = enet_host_connect (sd->server, & address, 1, 0); peer->data = enet_conn_data; svc->trace_out(cm, "ENET ======== On init Assigning peer %p has data %p\n", peer, enet_conn_data); if (peer == NULL) { fprintf (stderr, Loading @@ -441,9 +441,18 @@ initiate_conn(CManager cm, CMtrans_services svc, transport_entry trans, } /* Wait up to 'timeout' milliseconds for the connection attempt to succeed. */ retry: if ((enet_host_service (sd->server, & event, timeout) > 0) && (event.type == ENET_EVENT_TYPE_CONNECT)) { int finished = 0; int got_connection = 0; enet_uint32 end = enet_time_get() + timeout; while (!finished) { int ret = enet_host_service (sd->server, & event, 100); enet_uint32 now = enet_time_get(); if (now > end) { finished = 1; } if (ret <= 0) continue; switch(event.type) { case ENET_EVENT_TYPE_CONNECT: { if (event.peer != peer) { enet_conn_data_ptr enet_connection_data; struct in_addr addr; Loading @@ -458,21 +467,34 @@ retry: svc->trace_out(cm, "ENET ======== Assigning peer %p has data %p\n", event.peer, enet_connection_data); event.peer->data = enet_connection_data; ((enet_conn_data_ptr)enet_connection_data)->peer = event.peer; goto retry; } svc->trace_out(cm, "Connection to %s:%d succeeded.\n", inet_ntoa(sin_addr), address.port); enet_host_flush (sd->server); } else { if ((event.type == ENET_EVENT_TYPE_DISCONNECT) || (event.type == ENET_EVENT_TYPE_NONE)) { /* Either the 5 seconds are up or a disconnect event was */ /* received. Reset the peer in the event the 5 seconds */ /* had run out without any significant event. */ enet_host_flush (sd->server); svc->trace_out(cm, "Connection to %s:%d succeeded.\n", inet_ntoa(sin_addr), address.port); finished = 1; got_connection = 1; } break; } case ENET_EVENT_TYPE_NONE: break; case ENET_EVENT_TYPE_DISCONNECT: if (event.peer == peer) { enet_peer_reset (peer); svc->trace_out(cm, "Connection to %s:%d failed type was %d.\n", inet_ntoa(sin_addr), address.port, event.type); return 0; } else { enet_conn_data_ptr enet_conn_data = event.peer->data; svc->trace_out(cm, "Got a disconnect on connection %p\n", event.peer->data); } else if (event.type == ENET_EVENT_TYPE_RECEIVE) { enet_conn_data = event.peer->data; enet_conn_data->read_buffer_len = -1; svc->connection_fail(enet_conn_data->conn); } break; case ENET_EVENT_TYPE_RECEIVE: { enet_conn_data_ptr econn_d = event.peer->data; queued_data entry = malloc(sizeof(*entry)); entry->next = NULL; Loading @@ -488,12 +510,16 @@ retry: } last->next = entry; } goto retry; break; } } } svc->trace_out(cm, "--> Connection established"); if (!got_connection) { svc->trace_out(cm, "--> Connection failed because of timeout"); return 0; } svc->trace_out(cm, "--> Connection established\n"); enet_conn_data->remote_host = host_name == NULL ? NULL : strdup(host_name); enet_conn_data->remote_IP = htonl(host_ip); enet_conn_data->remote_contact_port = int_port_num; Loading Loading @@ -963,6 +989,7 @@ libcmenet_LTX_initialize(CManager cm, CMtrans_services svc, fprintf (stderr, "An error occurred while initializing ENet.\n"); //return EXIT_FAILURE; } enet_time_set(0); /* rollover in 50 days */ } if (atom_init == 0) { CM_ENET_HOSTNAME = attr_atom_from_string("CM_ENET_HOST"); Loading Loading
thirdparty/EVPath/EVPath/CMakeLists.txt +4 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,10 @@ endif() # udt4 transport set(RUN_UDT4_TESTS FALSE) if(NOT(DEFINED EVPATH_USE_UDT4)) #UDT4 not particularly functional, default to not building set(EVPATH_USE_UDT4 FALSE) endif() if(DEFINED EVPATH_USE_UDT4) option(EVPATH_USE_UDT4 "Build the udt4 transport" "${EVPATH_USE_UDT4}") if(EVPATH_USE_UDT4) Loading
thirdparty/EVPath/EVPath/cm.c +7 −7 Original line number Diff line number Diff line Loading @@ -3677,12 +3677,12 @@ typedef struct foreign_handler_struct { static handler_list foreign_handler_list; static int foreign_handler_count = 0; static void clear_foreign_handlers() { if (foreign_handler_count == 0) return; free(foreign_handler_list); } /* static void */ /* clear_foreign_handlers() */ /* { */ /* if (foreign_handler_count == 0) return; */ /* free(foreign_handler_list); */ /* } */ extern void INT_CMregister_non_CM_message_handler(int header, CMNonCMHandler handler) Loading @@ -3693,7 +3693,7 @@ clear_foreign_handlers() (foreign_handler_count + 1)); } else { foreign_handler_list = INT_CMmalloc(sizeof(foreign_handler_list[0])); atexit(clear_foreign_handlers); /* atexit(clear_foreign_handlers);*/ } foreign_handler_list[foreign_handler_count].header = header; foreign_handler_list[foreign_handler_count].handler = handler; Loading
thirdparty/EVPath/EVPath/cm_transport.c +25 −25 Original line number Diff line number Diff line Loading @@ -28,30 +28,30 @@ extern struct CMtrans_services_s CMstatic_trans_svcs; static transport_entry *global_transports = NULL; static void free_global_transports() { int i = 0; transport_entry *tmp; if (global_transports == NULL) { return; } else { tmp = global_transports; global_transports = NULL; } while (tmp[i]) { #if !NO_DYNAMIC_LINKING CMdlclose(tmp[i]->dlhandle); #endif free(tmp[i]->trans_name); free(tmp[i]); i++; } free(tmp); #if !NO_DYNAMIC_LINKING CMdlclearsearchlist(); #endif } /* static void */ /* free_global_transports() */ /* { */ /* int i = 0; */ /* transport_entry *tmp; */ /* if (global_transports == NULL) { */ /* return; */ /* } else { */ /* tmp = global_transports; */ /* global_transports = NULL; */ /* } */ /* while (tmp[i]) { */ /* #if !NO_DYNAMIC_LINKING */ /* CMdlclose(tmp[i]->dlhandle); */ /* #endif */ /* free(tmp[i]->trans_name); */ /* free(tmp[i]); */ /* i++; */ /* } */ /* free(tmp); */ /* #if !NO_DYNAMIC_LINKING */ /* CMdlclearsearchlist(); */ /* #endif */ /* } */ int find_transport_in_cm(CManager cm, const char *trans_name) Loading Loading @@ -293,7 +293,7 @@ load_transport(CManager cm, const char *trans_name, int quiet) } else { global_transports = INT_CMmalloc(sizeof(global_transports) * (i + 2)); atexit(free_global_transports); /* atexit(free_global_transports);*/ } global_transports[i] = transport; global_transports[i + 1] = NULL; Loading
thirdparty/EVPath/EVPath/cmenet.c +62 −35 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #include <string.h> #include <stdio.h> #include <limits.h> #include <pthread.h> #include <enet/enet.h> #include <arpa/inet.h> Loading Loading @@ -432,7 +433,6 @@ initiate_conn(CManager cm, CMtrans_services svc, transport_entry trans, peer = enet_host_connect (sd->server, & address, 1, 0); peer->data = enet_conn_data; svc->trace_out(cm, "ENET ======== On init Assigning peer %p has data %p\n", peer, enet_conn_data); if (peer == NULL) { fprintf (stderr, Loading @@ -441,9 +441,18 @@ initiate_conn(CManager cm, CMtrans_services svc, transport_entry trans, } /* Wait up to 'timeout' milliseconds for the connection attempt to succeed. */ retry: if ((enet_host_service (sd->server, & event, timeout) > 0) && (event.type == ENET_EVENT_TYPE_CONNECT)) { int finished = 0; int got_connection = 0; enet_uint32 end = enet_time_get() + timeout; while (!finished) { int ret = enet_host_service (sd->server, & event, 100); enet_uint32 now = enet_time_get(); if (now > end) { finished = 1; } if (ret <= 0) continue; switch(event.type) { case ENET_EVENT_TYPE_CONNECT: { if (event.peer != peer) { enet_conn_data_ptr enet_connection_data; struct in_addr addr; Loading @@ -458,21 +467,34 @@ retry: svc->trace_out(cm, "ENET ======== Assigning peer %p has data %p\n", event.peer, enet_connection_data); event.peer->data = enet_connection_data; ((enet_conn_data_ptr)enet_connection_data)->peer = event.peer; goto retry; } svc->trace_out(cm, "Connection to %s:%d succeeded.\n", inet_ntoa(sin_addr), address.port); enet_host_flush (sd->server); } else { if ((event.type == ENET_EVENT_TYPE_DISCONNECT) || (event.type == ENET_EVENT_TYPE_NONE)) { /* Either the 5 seconds are up or a disconnect event was */ /* received. Reset the peer in the event the 5 seconds */ /* had run out without any significant event. */ enet_host_flush (sd->server); svc->trace_out(cm, "Connection to %s:%d succeeded.\n", inet_ntoa(sin_addr), address.port); finished = 1; got_connection = 1; } break; } case ENET_EVENT_TYPE_NONE: break; case ENET_EVENT_TYPE_DISCONNECT: if (event.peer == peer) { enet_peer_reset (peer); svc->trace_out(cm, "Connection to %s:%d failed type was %d.\n", inet_ntoa(sin_addr), address.port, event.type); return 0; } else { enet_conn_data_ptr enet_conn_data = event.peer->data; svc->trace_out(cm, "Got a disconnect on connection %p\n", event.peer->data); } else if (event.type == ENET_EVENT_TYPE_RECEIVE) { enet_conn_data = event.peer->data; enet_conn_data->read_buffer_len = -1; svc->connection_fail(enet_conn_data->conn); } break; case ENET_EVENT_TYPE_RECEIVE: { enet_conn_data_ptr econn_d = event.peer->data; queued_data entry = malloc(sizeof(*entry)); entry->next = NULL; Loading @@ -488,12 +510,16 @@ retry: } last->next = entry; } goto retry; break; } } } svc->trace_out(cm, "--> Connection established"); if (!got_connection) { svc->trace_out(cm, "--> Connection failed because of timeout"); return 0; } svc->trace_out(cm, "--> Connection established\n"); enet_conn_data->remote_host = host_name == NULL ? NULL : strdup(host_name); enet_conn_data->remote_IP = htonl(host_ip); enet_conn_data->remote_contact_port = int_port_num; Loading Loading @@ -963,6 +989,7 @@ libcmenet_LTX_initialize(CManager cm, CMtrans_services svc, fprintf (stderr, "An error occurred while initializing ENet.\n"); //return EXIT_FAILURE; } enet_time_set(0); /* rollover in 50 days */ } if (atom_init == 0) { CM_ENET_HOSTNAME = attr_atom_from_string("CM_ENET_HOST"); Loading