From: Amos Jeffries Date: Tue, 21 Apr 2009 15:07:51 +0000 (+1200) Subject: Cleanups: Shuffle ClientInfo into a class X-Git-Tag: SQUID_3_2_0_1~1055 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c898d4ccabe93f579eca1841dc67741171f55f9;p=thirdparty%2Fsquid.git Cleanups: Shuffle ClientInfo into a class - upgrade struct+typedef to public class - gets its own header as pre-requisite to Logs SourceLayout --- diff --git a/src/ClientInfo.h b/src/ClientInfo.h new file mode 100644 index 0000000000..0d91f76690 --- /dev/null +++ b/src/ClientInfo.h @@ -0,0 +1,29 @@ +#ifndef SQUID__SRC_CLIENTINFO_H +#define SQUID__SRC_CLIENTINFO_H + +#include "ip/IpAddress.h" + +class ClientInfo { +public: + hash_link hash; /* must be first */ + + IpAddress addr; + + struct { + int result_hist[LOG_TYPE_MAX]; + int n_requests; + kb_t kbytes_in; + kb_t kbytes_out; + kb_t hit_kbytes_out; + } Http, Icp; + + struct { + time_t time; + int n_req; + int n_denied; + } cutoff; + int n_established; /* number of current established connections */ + time_t last_seen; +}; + +#endif diff --git a/src/client_db.cc b/src/client_db.cc index 954ccb3fe9..855ae0db68 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -1,4 +1,3 @@ - /* * $Id$ * @@ -36,6 +35,7 @@ #include "squid.h" #include "event.h" #include "CacheManager.h" +#include "ClientInfo.h" #include "SquidTime.h" #include "Store.h" diff --git a/src/mem.cc b/src/mem.cc index 5d2797ac89..34c462c547 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -1,4 +1,3 @@ - /* * $Id$ * @@ -40,6 +39,7 @@ #include "event.h" #include "CacheManager.h" +#include "ClientInfo.h" #include "Mem.h" #include "memMeter.h" #include "Store.h" diff --git a/src/structs.h b/src/structs.h index d4b9a9f24f..4b0b564def 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1255,28 +1255,6 @@ struct _HttpHeaderStat { }; -struct _ClientInfo { - hash_link hash; /* must be first */ - - IpAddress addr; - - struct { - int result_hist[LOG_TYPE_MAX]; - int n_requests; - kb_t kbytes_in; - kb_t kbytes_out; - kb_t hit_kbytes_out; - } Http, Icp; - - struct { - time_t time; - int n_req; - int n_denied; - } cutoff; - int n_established; /* number of current established connections */ - time_t last_seen; -}; - struct _CacheDigest { /* public, read-only */ char *mask; /* bit mask */ diff --git a/src/typedefs.h b/src/typedefs.h index 0452f7b2aa..474864f278 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -165,8 +165,6 @@ typedef struct _storeSwapLogData storeSwapLogData; typedef struct _StatHist StatHist; -typedef struct _ClientInfo ClientInfo; - typedef struct _cd_guess_stats cd_guess_stats; typedef struct _CacheDigest CacheDigest;