"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/http/clientinfo.h" between
openlitespeed-1.7.11.src.tgz and openlitespeed-1.7.12.src.tgz

About: OpenLiteSpeed is a high-performance, lightweight HTTP server with optional HTTP/2 support (open sourve version of the commercial LiteSpeed Web Server). Sources.

clientinfo.h  (openlitespeed-1.7.11.src.tgz):clientinfo.h  (openlitespeed-1.7.12.src.tgz)
skipping to change at line 29 skipping to change at line 29
#define CLIENTINFO_H #define CLIENTINFO_H
#include <config.h> #include <config.h>
#include <lsdef.h> #include <lsdef.h>
#include <http/throttlecontrol.h> #include <http/throttlecontrol.h>
#include <lsiapi/lsimoduledata.h> #include <lsiapi/lsimoduledata.h>
#include <util/autostr.h> #include <util/autostr.h>
#include <http/ip2geo.h> #include <http/ip2geo.h>
enum BOT_REASON
{
BOT_UNKOWN,
BOT_OVER_SOFT,
BOT_OVER_HARD,
BOT_TOO_MANY_BAD_REQ,
BOT_CAPTCHA,
BOT_FLOOD,
BOT_REWRITE_RULE,
BOT_TOO_MANY_BAD_STATUS,
BOT_BRUTE_FORCE,
BOT_REASON_COUNT,
};
#define CIF_NEED_RESET (1<<0) #define CIF_NEED_RESET (1<<0)
#define CIF_GOOG_TEST (1<<1) #define CIF_GOOG_TEST (1<<1)
#define CIF_GOOG_REAL (1<<2) #define CIF_GOOG_REAL (1<<2)
#define CIF_GOOG_FAKE (1<<3) #define CIF_GOOG_FAKE (1<<3)
#define CIF_CAPTCHA_PENDING (1<<4) #define CIF_GOOG_RDNS (1<<4)
#define CIF_CAPTCHA_PENDING (1<<5)
#define CIF_TEST_LOCAL_ADDR (1<<6)
#define CIF_LOCAL_ADDR (1<<7)
#if 0 #if 0
#include <shm/lsshmcache.h> #include <shm/lsshmcache.h>
// //
// Data in the SHM // Data in the SHM
// //
// NOT READY - will continue later // NOT READY - will continue later
typedef struct lsShmClientInfo_s typedef struct lsShmClientInfo_s
{ {
skipping to change at line 82 skipping to change at line 99
LocInfo *m_pLocInfo; LocInfo *m_pLocInfo;
#endif #endif
time_t m_tmOverLimit; time_t m_tmOverLimit;
short m_sslNewConn; short m_sslNewConn;
uint16_t m_iCaptchaTries; uint16_t m_iCaptchaTries;
uint16_t m_iAllowedBotHits; uint16_t m_iAllowedBotHits;
int m_iHits; int m_iHits;
time_t m_lastConnect; time_t m_lastConnect;
int m_iAccess; int m_iAccess;
enum BOT_REASON m_bot_reason;
ThrottleControl m_ctlThrottle; ThrottleControl m_ctlThrottle;
static int s_iSoftLimitPC; static int s_iSoftLimitPC;
static int s_iHardLimitPC; static int s_iHardLimitPC;
static int s_iOverLimitGracePeriod; static int s_iOverLimitGracePeriod;
static int s_iBanPeriod; static int s_iBanPeriod;
static uint16_t s_iMaxAllowedBotHits; static uint16_t s_iMaxAllowedBotHits;
//time_t //time_t
//int m_iBadReqs; //int m_iBadReqs;
//int m_iGoodReqs; //int m_iGoodReqs;
skipping to change at line 124 skipping to change at line 142
{ return (struct sockaddr *)m_achSockAddr; } { return (struct sockaddr *)m_achSockAddr; }
struct sockaddr * getAddr() struct sockaddr * getAddr()
{ return (struct sockaddr *)m_achSockAddr; } { return (struct sockaddr *)m_achSockAddr; }
void setAddr(const struct sockaddr *pAddr); void setAddr(const struct sockaddr *pAddr);
bool isFromLocalAddr(const sockaddr* server_addr) const; bool isFromLocalAddr(const sockaddr* server_addr) const;
void clearFlag( int flag ) { m_iFlags &= ~flag; } void clearFlag( int flag ) { m_iFlags &= ~flag; }
void setFlag( int flag ) { m_iFlags |= flag; } void setFlag( int flag ) { m_iFlags |= flag; }
int getFlag( int flag ) const { return m_iFlags & flag; }
int isFlagSet( int flag ) const { return m_iFlags & flag; } int isFlagSet( int flag ) const { return m_iFlags & flag; }
int isNeedTestHost() const int isNeedTestHost() const
{ return m_iFlags & CIF_GOOG_TEST; } { return m_iFlags & CIF_GOOG_TEST; }
int checkHost(); int checkHost();
void verifyIp(void *ip, const long length); void verifyIp(void *ip, const long length);
const char *getAddrString() const { return m_sAddr.c_str(); } const char *getAddrString() const { return m_sAddr.c_str(); }
int getAddrStrLen() const { return m_sAddr.len(); } int getAddrStrLen() const { return m_sAddr.len(); }
void setHostName(const char *p) void setHostName(const char *p)
{ {
if (p) m_sHostName.setStr(p); if (p) m_sHostName.setStr(p);
else m_sHostName.setStr("", 0); else m_sHostName.setStr("", 0);
} }
const char *getHostName() const { return m_sHostName.c_str(); } const char *getHostName() const { return m_sHostName.c_str(); }
int getHostNameLen() const { return m_sHostName.len(); } int getHostNameLen() const { return m_sHostName.len(); }
size_t incConn() { return ++m_iConns; } int32_t incConn() { return ++m_iConns; }
size_t decConn() { return --m_iConns; } int32_t decConn() { return --m_iConns; }
size_t getConns() const { return m_iConns; } int32_t getConns() const { return m_iConns; }
void incCaptchaTries() { ++m_iCaptchaTries; } void incCaptchaTries() { ++m_iCaptchaTries; }
uint16_t getCaptchaTries() const { return m_iCaptchaTries; } uint16_t getCaptchaTries() const { return m_iCaptchaTries; }
void resetCaptchaTries() { m_iCaptchaTries = 0; } void resetCaptchaTries() { m_iCaptchaTries = 0; }
void incAllowedBotHits() { ++m_iAllowedBotHits; } void incAllowedBotHits() { ++m_iAllowedBotHits; }
uint16_t getAllowedBotHits() const { return m_iAllowedBotHits; } uint16_t getAllowedBotHits() const { return m_iAllowedBotHits; }
void resetAllowedBotHits() { m_iAllowedBotHits = 0; } void resetAllowedBotHits() { m_iAllowedBotHits = 0; }
bool isReachBotLimit() const bool isReachBotLimit() const
{ return (getAllowedBotHits() >= getMaxAllowedBotHits()); } { return (getAllowedBotHits() >= getMaxAllowedBotHits()); }
skipping to change at line 191 skipping to change at line 210
delete m_pGeoInfo; delete m_pGeoInfo;
m_pGeoInfo = geoInfo; m_pGeoInfo = geoInfo;
} }
GeoInfo *getGeoInfo() const { return m_pGeoInfo; } GeoInfo *getGeoInfo() const { return m_pGeoInfo; }
#ifdef USE_IP2LOCATION #ifdef USE_IP2LOCATION
LocInfo *allocateLocInfo(); LocInfo *allocateLocInfo();
LocInfo *getLocInfo() const { return m_pLocInfo; } LocInfo *getLocInfo() const { return m_pLocInfo; }
#endif #endif
int markAsBot(const char * pDomain, enum BOT_REASON reason);
void setBotReason(enum BOT_REASON reason)
{ m_bot_reason = reason; }
enum BOT_REASON getBotReason() const
{ return m_bot_reason; }
LsiModuleData *getModuleData() { return &m_moduleData; } LsiModuleData *getModuleData() { return &m_moduleData; }
static void setPerClientSoftLimit(int val) static void setPerClientSoftLimit(int val)
{ s_iSoftLimitPC = val; } { s_iSoftLimitPC = val; }
static int getPerClientSoftLimit() static int getPerClientSoftLimit()
{ return s_iSoftLimitPC; } { return s_iSoftLimitPC; }
static void setPerClientHardLimit(int val) static void setPerClientHardLimit(int val)
{ s_iHardLimitPC = val; } { s_iHardLimitPC = val; }
static int getPerClientHardLimit() static int getPerClientHardLimit()
 End of changes. 6 change blocks. 
4 lines changed or deleted 29 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)