[0001]
[0002]
[0003]
[0004]
[0005]
[0006]
[0007]
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
/*****************************************************************************/
/*
                                  Throttle.h
*/
/*****************************************************************************/

#ifndef THROTTLE_H_LOADED
#define THROTTLE_H_LOADED 1

#include "wasd.h"

/**************/
/* structures */
/**************/

typedef struct ThrottlePerUserStruct THROTTLE_PER_USER_STRUCT;

struct ThrottlePerUserStruct
{
   int  CurrentProcessingCount,
        CurrentQueuedCount,
        TotalCount;
   char  RemoteUser [AUTH_MAX_USERNAME_LENGTH+1];
   struct ThrottlePerUserStruct  *NextUserPtr;
};

typedef struct ThrottleStruct THROTTLE_STRUCT;

struct ThrottleStruct
{
   /* count of requests for this path currently being processed */
   int  CurrentProcessingCount,
        CurrentQueuedCount,
        CurrentPerUserCount,
        MaxPerUserCount,
        MaxProcessingCount,
        MaxQueuedCount,
        Total503Count,
        TotalCount,
        TotalQueuedCount,
        TotalFiFoCount,
        TotalTimeoutBusyCount,
        TotalTimeoutQueueCount;

   /* for per-user queueing */
   struct ThrottlePerUserStruct  *FirstUserPtr;

   /* list of pointers to requests waiting for processing */
   LIST_HEAD  QueuedList;
};

/***********************/
/* function prototypes */
/***********************/

ThrottleBegin (REQUEST_STRUCT*);
ThrottleControl (BOOL, int, char*, char*);
ThrottleEnd (REQUEST_STRUCT*);
ThrottleInit ();
ThrottleMonitorReset ();
ThrottleRelease (REQUEST_STRUCT*, THROTTLE_PER_USER_STRUCT*, int);
ThrottleReport (REQUEST_STRUCT*);
ThrottleTimeout (REQUEST_STRUCT*);
ThrottleZero ();

#endif /* THROTTLE_H_LOADED */

/*****************************************************************************/