From 4311db5d742f03080dfa58aeba45dadc175c625c Mon Sep 17 00:00:00 2001 From: sotech117 Date: Wed, 20 Sep 2023 01:55:59 -0400 Subject: more small things to fit assignment spec --- snowcast_server_concurrent.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'snowcast_server_concurrent.c') 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)); -- cgit v1.2.3-70-g09d2