|
@@ -12,6 +12,7 @@
|
|
|
|
|
|
#define VERBOSE_NET
|
|
#define VERBOSE_NET
|
|
// #define DEBUG_NET_CLIENTS
|
|
// #define DEBUG_NET_CLIENTS
|
|
|
|
+#define PROFILE_NET_CLIENTS
|
|
|
|
|
|
#define CEILDIV(x,y) (((x)+(y)-1)/(y))
|
|
#define CEILDIV(x,y) (((x)+(y)-1)/(y))
|
|
|
|
|
|
@@ -242,7 +243,7 @@ uint64_t NetIO::reset_bytes_sent()
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
- Receive clients dropped off messages, i.e. a CLIENT_MESSAGE_BUNDLE
|
|
|
|
|
|
+ Receive clients' dropped-off messages, i.e. a CLIENT_MESSAGE_BUNDLE
|
|
*/
|
|
*/
|
|
|
|
|
|
void NetIO::ing_receive_msgbundle(tcp::socket* csocket, clientid_t c_simid)
|
|
void NetIO::ing_receive_msgbundle(tcp::socket* csocket, clientid_t c_simid)
|
|
@@ -257,10 +258,10 @@ void NetIO::ing_receive_msgbundle(tcp::socket* csocket, clientid_t c_simid)
|
|
if(ec == boost::asio::error::eof) {
|
|
if(ec == boost::asio::error::eof) {
|
|
// Client connection terminated so we delete this socket
|
|
// Client connection terminated so we delete this socket
|
|
delete(csocket);
|
|
delete(csocket);
|
|
- }
|
|
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
printf("Error ing_receive_msgbundle : %s\n", ec.message().c_str());
|
|
printf("Error ing_receive_msgbundle : %s\n", ec.message().c_str());
|
|
}
|
|
}
|
|
|
|
+ free(msgbundle);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -328,9 +329,9 @@ void NetIO::ing_authenticate_new_client(tcp::socket* csocket,
|
|
} else {
|
|
} else {
|
|
printf("Error ing_auth_new_client : %s\n", ec.message().c_str());
|
|
printf("Error ing_auth_new_client : %s\n", ec.message().c_str());
|
|
}
|
|
}
|
|
|
|
+ free(auth_message);
|
|
return;
|
|
return;
|
|
- }
|
|
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
clientid_t c_simid = *((clientid_t *)(auth_message));
|
|
clientid_t c_simid = *((clientid_t *)(auth_message));
|
|
// Read the authentication token
|
|
// Read the authentication token
|
|
unsigned char *auth_ptr = auth_message + sizeof(clientid_t);
|
|
unsigned char *auth_ptr = auth_message + sizeof(clientid_t);
|
|
@@ -386,6 +387,7 @@ void NetIO::stg_authenticate_new_client(tcp::socket* csocket,
|
|
} else {
|
|
} else {
|
|
printf("Error stg_auth_new_client: %s\n", ec.message().c_str());
|
|
printf("Error stg_auth_new_client: %s\n", ec.message().c_str());
|
|
}
|
|
}
|
|
|
|
+ free(auth_message);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -634,7 +636,7 @@ NetIO::NetIO(boost::asio::io_context &io_context, const Config &config)
|
|
|
|
|
|
|
|
|
|
if(myconf.roles & ROLE_STORAGE) {
|
|
if(myconf.roles & ROLE_STORAGE) {
|
|
- // Setup the client sockets
|
|
|
|
|
|
+ // Set up the client sockets
|
|
// Compute no_of_clients per storage_server
|
|
// Compute no_of_clients per storage_server
|
|
uint32_t num_users = config.user_count;
|
|
uint32_t num_users = config.user_count;
|
|
NodeConfig nc;
|
|
NodeConfig nc;
|