}
if (escape) {
/* Ok, An escaped form was found above. Use it */
- strncpy(dst, escape, 6);
+ strncpy(dst, escape, 7);
dst += strlen(escape);
} else {
/* Apparently there is no need to escape this character */
#include "StoreStats.h"
#include "tools.h"
-/* StoreInfoStats */
-
-StoreInfoStats::StoreInfoStats()
-{
- memset(this, 0, sizeof(*this));
-}
-
StoreInfoStats &
StoreInfoStats::operator +=(const StoreInfoStats &stats)
{
class Part
{
public:
- double size; ///< bytes currently in use
- double count; ///< number of cached objects
- double capacity; ///< the size limit
+ double size = 0.0; ///< bytes currently in use
+ double count = 0.0; ///< number of cached objects
+ double capacity = 0.0; ///< the size limit
/// mean size of a cached object
double meanObjectSize() const { return count > 0 ? size/count : 0.0; }
class Swap: public Part
{
public:
- double open_disk_fd; ///< number of opened disk files
+ double open_disk_fd = 0.0; ///< number of opened disk files
};
/// memory cache (cache_mem) storage stats
class Mem: public Part
{
public:
- bool shared; ///< whether memory cache is shared among workers
+ bool shared = false; ///< whether memory cache is shared among workers
};
- StoreInfoStats();
StoreInfoStats &operator +=(const StoreInfoStats &stats);
Swap swap; ///< cache_mem stats
Mem mem; ///< all cache_dirs stats
/* stats that could be shared by memory and disk storage */
- double store_entry_count; ///< number of StoreEntry objects in existence
- double mem_object_count; ///< number of MemObject objects in existence
+ double store_entry_count = 0.0; ///< number of StoreEntry objects in existence
+ double mem_object_count = 0.0; ///< number of MemObject objects in existence
};
// TODO: this should be adjusted for use in StoreIoActionData, DiskdActionData
return os << raw[0] << '-' << raw[1] << '-' << raw[2];
}
-StoreSwapLogData::StoreSwapLogData()
-{
- memset(this, 0, sizeof(*this));
-}
-
bool
StoreSwapLogData::sane() const
{
/// type to use for storing time-related members; must be signed
typedef int64_t SwappedTime;
- StoreSwapLogData();
-
/// consistency self-check: whether the data appears to make sense
bool sane() const;
* Either SWAP_LOG_ADD when an object is added to the disk storage,
* or SWAP_LOG_DEL when an object is deleted.
*/
- uint8_t op;
+ uint8_t op = 0;
/**
* Fingerprint to weed out bogus/corrupted swap.state entries.
* are set at run time because the order of storage directories
* may change over time.
*/
- sfileno swap_filen;
+ sfileno swap_filen = 0;
/**
* A Unix time value that represents the time when
* to that time. Otherwise, it is set to the Squid process time
* when the response is read (as soon as the end of headers are found).
*/
- SwappedTime timestamp;
+ SwappedTime timestamp = 0;
/**
* The last time that a client requested this object.
*/
- SwappedTime lastref;
+ SwappedTime lastref = 0;
/**
* The value of the response's Expires: header, if any.
* where Squid sets expires to -2. This happens for the
* internal "netdb" object and for FTP URL responses.
*/
- SwappedTime expires;
+ SwappedTime expires = 0;
/**
* The value of the response's Last-modified: header, if any.
* This is set to -1 if there is no Last-modified: header,
* or if it is unparseable.
*/
- SwappedTime lastmod;
+ SwappedTime lastmod = 0;
/**
* This is the number of bytes that the object occupies on
* disk. It includes the Squid "swap file header".
*/
- uint64_t swap_file_sz;
+ uint64_t swap_file_sz = 0;
/**
* The number of times that this object has been accessed (referenced).
* check when rebuilding the cache at startup. Objects that
* have the KEY_PRIVATE flag set are not added back to the cache.
*/
- uint16_t flags;
+ uint16_t flags = 0;
/**
* The 128-bit MD5 hash for this object.
*/
- unsigned char key[SQUID_MD5_DIGEST_LENGTH];
+ unsigned char key[SQUID_MD5_DIGEST_LENGTH] = {};
};
/// \ingroup FileFormatSwapStateAPI
goto cleanup;
if (major_status & GSS_S_CONTINUE_NEEDED) {
debug((char *) "%s| %s: INFO: continuation needed\n", LogTime(), PROGRAM);
- fprintf(stdout, "ERR token=%s\n", token);
+ // XXX: where to get the server token for delivery to client? token is nullptr here.
+ fprintf(stdout, "ERR\n");
goto cleanup;
}
gss_release_buffer(&minor_status, &output_token);
return -1;
}
-Ipc::OpenListenerParams::OpenListenerParams()
-{
- memset(this, 0, sizeof(*this));
-}
-
bool
Ipc::OpenListenerParams::operator <(const OpenListenerParams &p) const
{
class OpenListenerParams
{
public:
- OpenListenerParams();
-
bool operator <(const OpenListenerParams &p) const; ///< useful for map<>
// bits to re-create the fde entry
- int sock_type;
- int proto;
- int fdNote; ///< index into fd_note() comment strings
+ int sock_type = 0;
+ int proto = 0;
+ int fdNote = 0; ///< index into fd_note() comment strings
// bits to re-create the listener Comm::Connection descriptor
Ip::Address addr; ///< will be memset and memcopied
- int flags;
+ int flags = 0;
/// handler to subscribe to Comm::ConnAcceptor when we get the response
Subscription::Pointer handlerSubscription;
void DumpInfo(Mgr::InfoActionData& stats, StoreEntry* sentry);
void DumpMallocStatistics(StoreEntry* sentry);
-Mgr::InfoActionData::InfoActionData()
-{
- memset(this, 0, sizeof(*this));
-}
-
Mgr::InfoActionData&
Mgr::InfoActionData::operator += (const InfoActionData& stats)
{
class InfoActionData
{
public:
- InfoActionData();
InfoActionData& operator += (const InfoActionData& stats);
public:
- struct timeval squid_start;
- struct timeval current_time;
- double client_http_clients;
- double client_http_requests;
- double icp_pkts_recv;
- double icp_pkts_sent;
- double icp_replies_queued;
+ struct timeval squid_start = {};
+ struct timeval current_time = {};
+ double client_http_clients = 0.0;
+ double client_http_requests = 0.0;
+ double icp_pkts_recv = 0.0;
+ double icp_pkts_sent = 0.0;
+ double icp_replies_queued = 0.0;
#if USE_HTCP
- double htcp_pkts_recv;
- double htcp_pkts_sent;
+ double htcp_pkts_recv = 0.0;
+ double htcp_pkts_sent = 0.0;
#endif
- double request_failure_ratio;
- double avg_client_http_requests;
- double avg_icp_messages;
- double select_loops;
- double avg_loop_time;
- double request_hit_ratio5;
- double request_hit_ratio60;
- double byte_hit_ratio5;
- double byte_hit_ratio60;
- double request_hit_mem_ratio5;
- double request_hit_mem_ratio60;
- double request_hit_disk_ratio5;
- double request_hit_disk_ratio60;
+ double request_failure_ratio = 0.0;
+ double avg_client_http_requests = 0.0;
+ double avg_icp_messages = 0.0;
+ double select_loops = 0.0;
+ double avg_loop_time = 0.0;
+ double request_hit_ratio5 = 0.0;
+ double request_hit_ratio60 = 0.0;
+ double byte_hit_ratio5 = 0.0;
+ double byte_hit_ratio60 = 0.0;
+ double request_hit_mem_ratio5 = 0.0;
+ double request_hit_mem_ratio60 = 0.0;
+ double request_hit_disk_ratio5 = 0.0;
+ double request_hit_disk_ratio60 = 0.0;
StoreInfoStats store; ///< disk and memory cache statistics
- double unlink_requests;
- double http_requests5;
- double http_requests60;
- double cache_misses5;
- double cache_misses60;
- double cache_hits5;
- double cache_hits60;
- double near_hits5;
- double near_hits60;
- double not_modified_replies5;
- double not_modified_replies60;
- double dns_lookups5;
- double dns_lookups60;
- double icp_queries5;
- double icp_queries60;
- double up_time;
- double cpu_time;
- double cpu_usage;
- double cpu_usage5;
- double cpu_usage60;
- double maxrss;
- double page_faults;
+ double unlink_requests = 0.0;
+ double http_requests5 = 0.0;
+ double http_requests60 = 0.0;
+ double cache_misses5 = 0.0;
+ double cache_misses60 = 0.0;
+ double cache_hits5 = 0.0;
+ double cache_hits60 = 0.0;
+ double near_hits5 = 0.0;
+ double near_hits60 = 0.0;
+ double not_modified_replies5 = 0.0;
+ double not_modified_replies60 = 0.0;
+ double dns_lookups5 = 0.0;
+ double dns_lookups60 = 0.0;
+ double icp_queries5 = 0.0;
+ double icp_queries60 = 0.0;
+ double up_time = 0.0;
+ double cpu_time = 0.0;
+ double cpu_usage = 0.0;
+ double cpu_usage5 = 0.0;
+ double cpu_usage60 = 0.0;
+ double maxrss = 0.0;
+ double page_faults = 0.0;
#if HAVE_MSTATS && HAVE_GNUMALLOC_H
- double ms_bytes_total;
- double ms_bytes_free;
+ double ms_bytes_total = 0.0;
+ double ms_bytes_free = 0.0;
#endif
- double total_accounted;
- double gb_saved_count;
- double gb_freed_count;
- double max_fd;
- double biggest_fd;
- double number_fd;
- double opening_fd;
- double num_fd_free;
- double reserved_fd;
- unsigned int count;
+ double total_accounted = 0.0;
+ double gb_saved_count = 0.0;
+ double gb_freed_count = 0.0;
+ double max_fd = 0.0;
+ double biggest_fd = 0.0;
+ double number_fd = 0.0;
+ double opening_fd = 0.0;
+ double num_fd_free = 0.0;
+ double reserved_fd = 0.0;
+ unsigned int count = 0;
};
/// implement aggregated 'info' action
#include "StoreStats.h"
#include <cstring>
-StoreInfoStats::StoreInfoStats() STUB
-
StoreInfoStats &
StoreInfoStats::operator +=(const StoreInfoStats &stats) STUB_RETVAL(*this)
# --without-filedescriptors \
# --without-build-environment \
#
+# GCC-9 cannot (yet) test this due to segmentation faults in std::string template optimizations (via cppunit)
+# --disable-optimizations \
#
# NP: DISTCHECK_CONFIGURE_FLAGS is a magic automake macro for the
# distcheck target recursive tests beteen scripted runs.
--disable-build-info \
--disable-loadable-modules \
--disable-gnuregex \
- --disable-optimizations \
--disable-debug-cbdata \
--disable-xmalloc-statistics \
--disable-async-io \