your task is to modify read_from to see if we have received a username yet (how can we tell?), and allocate memory for the username field in the sockname struct and copy the name to the field for that client. After the username has been set, all new incoming messages from that connection will be messages to echo.
int read_from(int client_index, struct sockname *users) {
    int fd = users[client_index].sock_fd;
    char buf[BUF_SIZE + 1];

    /* In Lab 10, you focused on handling partial reads. For this lab, you do
     * not need handle partial reads. Because of that, this server program
     * does not check for "\r\n" when it reads from the client.
     */
    int num_read = read(fd, &buf, BUF_SIZE);
    buf[num_read] = '\0';
    if (num_read == 0 || write(fd, buf, strlen(buf)) != strlen(buf)) {
        users[client_index].sock_fd = -1;
        return fd;
    }

    return 0;
}
