diff options
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 46 |
1 files changed, 0 insertions, 46 deletions
@@ -848,52 +848,6 @@ void send_invalid_command_reply(int fd, size_t message_size, char* message) { free(send_buffer); } -// void init_station(int station_num, const char* station_name) { -// station_t *station = &station_data[station_num]; - -// // open the file -// int stream_fd = open(station_name, O_RDONLY); -// if (stream_fd == -1) { -// perror("open"); -// return; -// } -// station->streamFd = stream_fd; -// station->filePath = station_name; - -// // setup file buffer -// char stream_buffer[MAX_STREAM_RATE]; -// memset(stream_buffer, 0, MAX_STREAM_RATE); - -// station->fileBufferSize = MAX_STREAM_RATE; -// memcpy(&station->fileBufferSize, stream_buffer, MAX_STREAM_RATE); - - -// // load the first buffer into the stations -// seek_stations(station_num); -// } - -// void seek_stations(int station_num) { -// station_t *station_info = &station_data[station_num]; -// memset(&station_info->fileBuffer, 0, MAX_STREAM_RATE); -// int bytes_read = read(station_info->streamFd, &station_info->fileBuffer, MAX_STREAM_RATE); -// lseek(station_info->streamFd, -16, SEEK_SET); -// // printf("station info - bytes read: %d, station_fd: %d, filePath: %s, buffersize: %d\n", bytes_read, station_info->streamFd, station_info->filePath, station_info->fileBufferSize); - -// // time to restart the file -// if (bytes_read == 0) { -// if (lseek(station_info->streamFd, 0, SEEK_SET) == -1) { -// perror("fseek"); -// } -// pthread_t send_announce_thread; -// pthread_create(&send_announce_thread, NULL, send_announce_routine, (void *)station_num); - -// // load first chunk -// bytes_read = read(station_info->streamFd, &station_info->fileBuffer, MAX_STREAM_RATE); -// } -// station_info->fileBufferSize = bytes_read; -// } - - // Parses a buffer into tokens, from cs33 :) int parse(char buffer[LINE_MAX], char *tokens[LINE_MAX / 2]) { const char *regex = " \n\t\f\r"; |