aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-09-24 03:54:54 -0400
committersotech117 <michael_foiani@brown.edu>2023-09-24 03:54:54 -0400
commit28d4aacf00d6b7389dd2440060541a623ec25f1d (patch)
tree3effc115f96157947af3a6615c44aa17e7cbf2ea
parent538d22688c4ae07d8ee9b9d1ec2ebbe80adddf47 (diff)
important small things
-rw-r--r--client.c2
-rw-r--r--mp3/mgk/ChipOffTheBlock.mp3bin0 -> 6777187 bytes
-rw-r--r--server.c10
-rwxr-xr-xsnowcast_controlbin18808 -> 35245 bytes
-rwxr-xr-xsnowcast_listenerbin13656 -> 34270 bytes
-rwxr-xr-xsnowcast_serverbin37568 -> 71596 bytes
6 files changed, 8 insertions, 4 deletions
diff --git a/client.c b/client.c
index 6773c86..4ab7457 100644
--- a/client.c
+++ b/client.c
@@ -203,7 +203,7 @@ int main(int argc, char *argv[])
waiting = 0;
remove_timeout(sockfd);
fflush(stdout);
- printf("This station has shut down. Please select different station.\n");
+ printf("This station has shut down. Please select a different station.\n");
printf("snowcast_control> ");
fflush(stdout);
continue;
diff --git a/mp3/mgk/ChipOffTheBlock.mp3 b/mp3/mgk/ChipOffTheBlock.mp3
new file mode 100644
index 0000000..351fc99
--- /dev/null
+++ b/mp3/mgk/ChipOffTheBlock.mp3
Binary files differ
diff --git a/server.c b/server.c
index e6b4867..dd08599 100644
--- a/server.c
+++ b/server.c
@@ -807,8 +807,10 @@ void *send_stationsinfo_reply(void * arg) {
if (l) printf("sending STATIONSINFO reply to socket %d\n", fd);
uint8_t reply_size = 0;
- for (int i = 0; i < num_stations; i++)
- reply_size += snprintf(NULL, 0, "%d,%s\n", i, stations[i].filePath);
+ for (int i = 0; i < num_stations; i++) {
+ if (stations[i].readfd != -1)
+ reply_size += snprintf(NULL, 0, "%d,%s\n", i, stations[i].filePath);
+ }
reply_size--; // don't want final \n
// send type
@@ -821,8 +823,10 @@ void *send_stationsinfo_reply(void * arg) {
char send_buffer[reply_size];
int ptr = 0;
- for (int i = 0; i < num_stations; i++)
+ for (int i = 0; i < num_stations; i++) {
+ if (stations[i].readfd != -1)
ptr += sprintf(send_buffer + ptr, (i == num_stations - 1) ? "%d,%s" : "%d,%s\n", i, stations[i].filePath);
+ }
int bytes_to_send = reply_size; // don't want final \n
if (send_all(fd, &send_buffer, &bytes_to_send) == -1)
diff --git a/snowcast_control b/snowcast_control
index 5cab9dd..163b0f5 100755
--- a/snowcast_control
+++ b/snowcast_control
Binary files differ
diff --git a/snowcast_listener b/snowcast_listener
index f27a5c1..d15c2ac 100755
--- a/snowcast_listener
+++ b/snowcast_listener
Binary files differ
diff --git a/snowcast_server b/snowcast_server
index e217218..0f39e68 100755
--- a/snowcast_server
+++ b/snowcast_server
Binary files differ