#include #include #include #include #include #include #include #include #include #include #include #include "utils.h" #define SERVER_DEBUG 0 #define MY_PORT 48080 #define MY_PORT_2 58080 #define QUEUE_LENGTH 10 #define GUPPY_IP "152.2.128.185" #define MAX_REQUEST_SIZE 1000 #define MAX_FILENAME_LENGTH 200 #define FILE_CHUNK_SIZE 500 #define WEB_DOC_ROOT "html" int handle_connection(int the_socket); FILE * try_to_open(char * filename); static int gr; static int *global_running = &gr; int main() { int my_socket, new_socket; // conceptually socket descriptors int returncode, addrlen; // utility variables struct sockaddr_in my_addr; struct sockaddr_in their_addr; char buffer[MAX_REQUEST_SIZE + 1]; *global_running = 1; // Zeroth, initialize buffer int i; for(i=0; i 0) { for (i=0; i