diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-09-20 01:55:59 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-09-20 01:55:59 -0400 |
commit | 4311db5d742f03080dfa58aeba45dadc175c625c (patch) | |
tree | 48d0c9d27c0013ac0a223466201361ed9bf4da9d /snowcast_server_concurrent.c | |
parent | af44220248c7da4c2f66f5bd7ff018acfe623b03 (diff) |
more small things to fit assignment spec
Diffstat (limited to 'snowcast_server_concurrent.c')
-rw-r--r-- | snowcast_server_concurrent.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/snowcast_server_concurrent.c b/snowcast_server_concurrent.c index 4fa6d40..5a4ff9f 100644 --- a/snowcast_server_concurrent.c +++ b/snowcast_server_concurrent.c @@ -569,23 +569,26 @@ void *select_thread(void *arg) { // check if user has a udpPort if (user_data[sockfd_to_user[i]].udpPort == -1) { // send back in invalid command - char * message = "Must send Hello message first"; + char * message = "Must send Hello message first."; send_invalid_command_reply(i, strlen(message), message); // drop connection upon invalid command close(i); FD_CLR(i, &master); destroy_user(i); + continue; } int station_num = ntohs(command.number); + printf("station_num: %d\n", station_num); if (station_num >= num_stations || station_num < 0) { // send back in invalid command - char * message = "Station number out of range"; + char * message = "Station number out of range."; send_invalid_command_reply(i, strlen(message), message); // drop connection upon invalid command close(i); FD_CLR(i, &master); destroy_user(i); + continue; } // printf("setting station to %d\n", ntohs(command.number)); |