/*									tab:8
 *
 * pushy.h - main header for HTTP push server
 *
 * "Copyright (c) 1999 by Steven S. Lumetta."
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice and the following
 * two paragraphs appear in all copies of this software.
 * 
 * IN NO EVENT SHALL THE AUTHOR OR THE UNIVERSITY OF ILLINOIS BE LIABLE TO 
 * ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL 
 * DAMAGES ARISING OUT  OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, 
 * EVEN IF THE AUTHOR AND/OR THE UNIVERSITY OF ILLINOIS HAS BEEN ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * THE AUTHOR AND THE UNIVERSITY OF ILLINOIS SPECIFICALLY DISCLAIM ANY 
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE 
 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND NEITHER THE AUTHOR NOR
 * THE UNIVERSITY OF ILLINOIS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, 
 * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
 *
 * Author:	    Steve Lumetta
 * Version:	    1
 * Creation Date:   Wed Feb 17 17:48:57 1999
 * Filename:	    pushy.h
 * History:
 *	SL	1	Wed Feb 17 17:48:57 1999
 *		First written.
 */


#ident "$Id$"


#ifndef PUSHY_H
#define PUSHY_H


#include <netinet/in.h>
#include <time.h>


/* Each child thread maintains thread-specific data in a thread_info_t
   structure.  The structure is allocated and partially filled in by the main
   thread, but the child is responsible for deallocating the structure before
   terminating.
*/
typedef struct {
    int fd;                   /* client file descriptor           */
    struct sockaddr_in addr;  /* client Internet address          */
    char* fname;              /* file name of interest to client  */
    time_t last_sent;         /* time at which file was last sent */
                              /*     0 -> no response sent yet    */
                              /*     1 -> client re-requested     */
} thread_info_t;


/* The child thread routine, passed to pthread_create in the main server
   thread. */
void client_thread (thread_info_t* info);


#endif /* PUSHY_H */