aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcbin35150 -> 35150 bytes
-rw-r--r--c.dSYM/Contents/Resources/DWARF/cbin13761 -> 13761 bytes
-rw-r--r--client.c2
-rwxr-xr-xlbin34654 -> 34654 bytes
-rwxr-xr-xsbin54558 -> 54494 bytes
-rw-r--r--s.dSYM/Contents/Resources/DWARF/sbin21520 -> 21128 bytes
-rwxr-xr-xsnowcast_controlbin20992 -> 35165 bytes
-rw-r--r--snowcast_control.dSYM/Contents/Info.plist20
-rw-r--r--snowcast_control.dSYM/Contents/Resources/DWARF/snowcast_controlbin0 -> 13761 bytes
-rwxr-xr-xsnowcast_serverbin25336 -> 35116 bytes
-rw-r--r--snowcast_server.dSYM/Contents/Info.plist20
-rw-r--r--snowcast_server.dSYM/Contents/Resources/DWARF/snowcast_serverbin0 -> 15573 bytes
-rw-r--r--snowcast_server_concurrent.c27
13 files changed, 50 insertions, 19 deletions
diff --git a/c b/c
index a1f2a86..8e2e138 100755
--- a/c
+++ b/c
Binary files differ
diff --git a/c.dSYM/Contents/Resources/DWARF/c b/c.dSYM/Contents/Resources/DWARF/c
index c325e9f..7af6442 100644
--- a/c.dSYM/Contents/Resources/DWARF/c
+++ b/c.dSYM/Contents/Resources/DWARF/c
Binary files differ
diff --git a/client.c b/client.c
index 6e6c95a..5edff63 100644
--- a/client.c
+++ b/client.c
@@ -156,7 +156,7 @@ void *reply_thread_routine(void* args) {
printf("client: replyType: %d, stringSize: %d\n", buf[0], buf[1]);
// print the while buffer by char
for (int i = 0; i < recvbytes; i++) {
- printf("%d", buf[i]);
+ printf("%c ", buf[i]);
}
struct Reply reply;
diff --git a/l b/l
index 265f692..52aca28 100755
--- a/l
+++ b/l
Binary files differ
diff --git a/s b/s
index 63b39b5..b664e12 100755
--- a/s
+++ b/s
Binary files differ
diff --git a/s.dSYM/Contents/Resources/DWARF/s b/s.dSYM/Contents/Resources/DWARF/s
index 09cab17..feff9cb 100644
--- a/s.dSYM/Contents/Resources/DWARF/s
+++ b/s.dSYM/Contents/Resources/DWARF/s
Binary files differ
diff --git a/snowcast_control b/snowcast_control
index 24fe551..1ab5778 100755
--- a/snowcast_control
+++ b/snowcast_control
Binary files differ
diff --git a/snowcast_control.dSYM/Contents/Info.plist b/snowcast_control.dSYM/Contents/Info.plist
new file mode 100644
index 0000000..afe5b44
--- /dev/null
+++ b/snowcast_control.dSYM/Contents/Info.plist
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.snowcast_control</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
diff --git a/snowcast_control.dSYM/Contents/Resources/DWARF/snowcast_control b/snowcast_control.dSYM/Contents/Resources/DWARF/snowcast_control
new file mode 100644
index 0000000..76fce35
--- /dev/null
+++ b/snowcast_control.dSYM/Contents/Resources/DWARF/snowcast_control
Binary files differ
diff --git a/snowcast_server b/snowcast_server
index 8a4c1cc..444d321 100755
--- a/snowcast_server
+++ b/snowcast_server
Binary files differ
diff --git a/snowcast_server.dSYM/Contents/Info.plist b/snowcast_server.dSYM/Contents/Info.plist
new file mode 100644
index 0000000..789e734
--- /dev/null
+++ b/snowcast_server.dSYM/Contents/Info.plist
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.snowcast_server</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ </dict>
+</plist>
diff --git a/snowcast_server.dSYM/Contents/Resources/DWARF/snowcast_server b/snowcast_server.dSYM/Contents/Resources/DWARF/snowcast_server
new file mode 100644
index 0000000..0123b4a
--- /dev/null
+++ b/snowcast_server.dSYM/Contents/Resources/DWARF/snowcast_server
Binary files differ
diff --git a/snowcast_server_concurrent.c b/snowcast_server_concurrent.c
index 4387407..110792d 100644
--- a/snowcast_server_concurrent.c
+++ b/snowcast_server_concurrent.c
@@ -379,33 +379,24 @@ void *select_thread(void *arg) {
// update station of user
update_user_station(i, ntohs(command.number));
- const char* song_name = station_data[station_num].filePath;
- size_t song_name_size = strlen(song_name); // don't add 1, don't want to include the null terminator
- struct Announce *announce = malloc(sizeof *announce + song_name_size);
+ char* file_path = station_data[station_num].filePath;
+ int len_file_path = strlen(file_path);
- printf("song_name: %s\n", song_name);
+ char *send_buffer = malloc(len_file_path+2);
+ send_buffer[0] = 3;
+ send_buffer[1] = len_file_path;
- announce->replyType = 3;
- announce->songnameSize = song_name_size;
+ memcpy(send_buffer + 2, file_path, len_file_path);
- announce->songname = malloc(song_name_size);
- memcpy(announce->songname, song_name, song_name_size);
-
- // print out all fields on announce on one line
- printf("announce: %d %d %s\n", announce->replyType, announce->songnameSize, announce->songname);
-
- char* send_buffer[sizeof(struct Announce) + song_name_size];
- memcpy(send_buffer, announce, sizeof(struct Announce));
- memcpy(send_buffer+sizeof(struct Announce), song_name, song_name_size);
+ printf("buffer: %s\n", send_buffer);
int bytessent;
- if ((bytessent = send(newfd, send_buffer, sizeof(struct Announce) + song_name_size, 0)) == -1)
+ if ((bytessent = send(newfd, send_buffer, len_file_path + 2, 0)) == -1)
perror("send");
// print the number of bytes sent
printf("sent %d bytes\n", bytessent);
- free(announce->songname);
- free(announce);
+ free(send_buffer);
}
else {
// send back in invalid command