|
|
@ -16,6 +16,7 @@
|
|
|
|
#define BUFFER_SIZE 10000
|
|
|
|
#define BUFFER_SIZE 10000
|
|
|
|
#define MAX_CONNECTIONS 100
|
|
|
|
#define MAX_CONNECTIONS 100
|
|
|
|
#define DATA_SIZE 50000
|
|
|
|
#define DATA_SIZE 50000
|
|
|
|
|
|
|
|
#define MESSAGE_SIZE 50000
|
|
|
|
|
|
|
|
|
|
|
|
User** create_user_list(char* filename);
|
|
|
|
User** create_user_list(char* filename);
|
|
|
|
void sigint_handler(int dummy);
|
|
|
|
void sigint_handler(int dummy);
|
|
|
@ -80,6 +81,9 @@ int main() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=1; i < MAX_CONNECTIONS; i++) {
|
|
|
|
for (int i=1; i < MAX_CONNECTIONS; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memset(data,0x00,DATA_SIZE);
|
|
|
|
|
|
|
|
|
|
|
|
if (FD_ISSET(conn_sockets[i],&read_fd_set)) {
|
|
|
|
if (FD_ISSET(conn_sockets[i],&read_fd_set)) {
|
|
|
|
|
|
|
|
|
|
|
|
while ( strstr(buffer,"END_OF_DATA") == NULL ) {
|
|
|
|
while ( strstr(buffer,"END_OF_DATA") == NULL ) {
|
|
|
@ -126,7 +130,9 @@ int main() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char* message_string = fetch_message_string(data);
|
|
|
|
char* message_string = malloc(sizeof(char) * MESSAGE_SIZE);
|
|
|
|
|
|
|
|
memset(message_string, 0x00, MESSAGE_SIZE);
|
|
|
|
|
|
|
|
message_string = fetch_message_string(data);
|
|
|
|
if (message_string == NULL) {
|
|
|
|
if (message_string == NULL) {
|
|
|
|
printf("Invalid message.\n");
|
|
|
|
printf("Invalid message.\n");
|
|
|
|
return -10;
|
|
|
|
return -10;
|
|
|
|