From: Amos Jeffries Date: Sat, 16 May 2015 08:41:00 +0000 (-0700) Subject: Fix various uninitialized class members X-Git-Tag: merge-candidate-3-v1~116 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cc8c4af29f05bd5ad815bb80604b21811d097116;p=thirdparty%2Fsquid.git Fix various uninitialized class members Detected by Coverity Scan. Issues 1297154, 1297153, 1294554, 1268241, 1268240, 1268239, 1268238, 1265722, 1264389, 1151595, 740579, 740574, 740562, 740561, 740560, 740559, 740558, 740542, 740541, 740540, 740525 --- diff --git a/src/FwdState.cc b/src/FwdState.cc index 78ce0c80ac..2b182f9bdd 100644 --- a/src/FwdState.cc +++ b/src/FwdState.cc @@ -129,18 +129,24 @@ FwdState::closeServerConnection(const char *reason) /**** PUBLIC INTERFACE ********************************************************/ FwdState::FwdState(const Comm::ConnectionPointer &client, StoreEntry * e, HttpRequest * r, const AccessLogEntryPointer &alp): - al(alp) + entry(e), + request(r), + al(alp), + err(NULL), + clientConn(client), + start_t(squid_curtime), + n_tries(0), + pconnRace(raceImpossible) { - debugs(17, 2, HERE << "Forwarding client request " << client << ", url=" << e->url() ); - entry = e; - clientConn = client; - request = r; + debugs(17, 2, "Forwarding client request " << client << ", url=" << e->url()); HTTPMSGLOCK(request); - pconnRace = raceImpossible; - start_t = squid_curtime; serverDestinations.reserve(Config.forward_max_tries); e->lock("FwdState"); EBIT_SET(e->flags, ENTRY_FWD_HDR_WAIT); + flags.connected_okay = false; + flags.dont_retry = false; + flags.forward_completed = false; + debugs(17, 3, "FwdState constructed, this=" << this); } // Called once, right after object creation, when it is safe to set self @@ -261,7 +267,7 @@ FwdState::completed() FwdState::~FwdState() { - debugs(17, 3, HERE << "FwdState destructor starting"); + debugs(17, 3, "FwdState destructor start"); if (! flags.forward_completed) completed(); @@ -288,7 +294,7 @@ FwdState::~FwdState() serverDestinations.clear(); - debugs(17, 3, HERE << "FwdState destructor done"); + debugs(17, 3, "FwdState destructed, this=" << this); } /** diff --git a/src/MemObject.cc b/src/MemObject.cc index 8d62a1d31e..497658519e 100644 --- a/src/MemObject.cc +++ b/src/MemObject.cc @@ -92,22 +92,31 @@ MemObject::setUris(char const *aStoreId, char const *aLogUri, const HttpRequestM #endif } -MemObject::MemObject(): smpCollapsed(false) +MemObject::MemObject() : + inmem_lo(0), + nclients(0), + smpCollapsed(false), + request(NULL), + ping_reply_callback(NULL), + ircb_data(NULL), + id(0), + object_sz(-1), + swap_hdr_sz(0), +#if URL_CHECKSUM_DEBUG + chksum(0), +#endif + vary_headers(NULL) { - debugs(20, 3, HERE << "new MemObject " << this); + debugs(20, 3, "new MemObject " << this); + memset(&start_ping, 0, sizeof(start_ping)); + memset(&abort, 0, sizeof(abort)); _reply = new HttpReply; HTTPMSGLOCK(_reply); - - object_sz = -1; - - /* XXX account log_url */ - - swapout.decision = SwapOut::swNeedsCheck; } MemObject::~MemObject() { - debugs(20, 3, HERE << "del MemObject " << this); + debugs(20, 3, "del MemObject " << this); const Ctx ctx = ctx_enter(hasUris() ? urlXXX() : "[unknown_ctx]"); #if URL_CHECKSUM_DEBUG diff --git a/src/MemObject.h b/src/MemObject.h index 13bdf6fac1..fcd67b9087 100644 --- a/src/MemObject.h +++ b/src/MemObject.h @@ -105,8 +105,9 @@ public: class SwapOut { - public: + SwapOut() : queue_offset(0), decision(swNeedsCheck) {} + int64_t queue_offset; ///< number of bytes sent to SwapDir for writing StoreIOState::Pointer sio; diff --git a/src/StatHist.cc b/src/StatHist.cc index 3eaa933218..0c9cec025f 100644 --- a/src/StatHist.cc +++ b/src/StatHist.cc @@ -39,8 +39,13 @@ StatHist::init(unsigned int newCapacity, hbase_f * val_in_, hbase_f * val_out_, } StatHist::StatHist(const StatHist &src) : - capacity_(src.capacity_), min_(src.min_), max_(src.max_), - scale_(src.scale_), val_in(src.val_in), val_out(src.val_out) + bins(NULL), + capacity_(src.capacity_), + min_(src.min_), + max_(src.max_), + scale_(src.scale_), + val_in(src.val_in), + val_out(src.val_out) { if (src.bins!=NULL) { bins = static_cast(xcalloc(src.capacity_, sizeof(bins_type))); @@ -60,7 +65,6 @@ StatHist::count(double v) unsigned int StatHist::findBin(double v) { - v -= min_; /* offset */ if (v <= 0.0) /* too small */ diff --git a/src/StoreIOState.cc b/src/StoreIOState.cc index 7b8213be4e..e1ab346341 100644 --- a/src/StoreIOState.cc +++ b/src/StoreIOState.cc @@ -26,21 +26,21 @@ StoreIOState::operator delete (void *) assert(0); } -StoreIOState::StoreIOState() : - swap_dirn(-1), swap_filen(-1), e(NULL), mode(O_BINARY), - offset_(0), file_callback(NULL), callback(NULL), callback_data(NULL) +StoreIOState::StoreIOState(StoreIOState::STFNCB *cbFile, StoreIOState::STIOCB *cbIo, void *data) : + swap_dirn(-1), + swap_filen(-1), + e(NULL), + mode(O_BINARY), + offset_(0), + file_callback(cbFile), + callback(cbIo), + callback_data(cbdataReference(data)) { read.callback = NULL; read.callback_data = NULL; flags.closing = false; } -off_t -StoreIOState::offset() const -{ - return offset_; -} - StoreIOState::~StoreIOState() { debugs(20,3, "StoreIOState::~StoreIOState: " << this); diff --git a/src/StoreIOState.h b/src/StoreIOState.h index 79df26d0fa..cc16dbc937 100644 --- a/src/StoreIOState.h +++ b/src/StoreIOState.h @@ -51,11 +51,11 @@ public: /* StoreIOState does not get mempooled - it's children do */ void *operator new (size_t amount); void operator delete (void *address); - virtual ~StoreIOState(); - StoreIOState(); + StoreIOState(StoreIOState::STFNCB *cbFile, StoreIOState::STIOCB *cbIo, void *data); + virtual ~StoreIOState(); - off_t offset() const; + off_t offset() const {return offset_;} virtual void read_(char *buf, size_t size, off_t offset, STRCB * callback, void *callback_data) = 0; /** write the given buffer and free it when it is no longer needed diff --git a/src/acl/FilledChecklist.cc b/src/acl/FilledChecklist.cc index b66f609904..16af5315f6 100644 --- a/src/acl/FilledChecklist.cc +++ b/src/acl/FilledChecklist.cc @@ -138,7 +138,7 @@ ACLFilledChecklist::ACLFilledChecklist(const acl_access *A, HttpRequest *http_re dst_rdns(NULL), request(NULL), reply(NULL), -#if USE_AUTh +#if USE_AUTH auth_user_request(NULL), #endif #if SQUID_SNMP @@ -147,6 +147,7 @@ ACLFilledChecklist::ACLFilledChecklist(const acl_access *A, HttpRequest *http_re #if USE_OPENSSL sslErrors(NULL), #endif + requestErrorType(ERR_MAX), conn_(NULL), fd_(-1), destinationDomainChecked_(false), diff --git a/src/acl/UserData.cc b/src/acl/UserData.cc index 93f4c348a0..0e1feb024d 100644 --- a/src/acl/UserData.cc +++ b/src/acl/UserData.cc @@ -68,6 +68,8 @@ CaseSensitveSBufCompare(const SBuf &lhs, const SBuf &rhs) ACLUserData::ACLUserData() : userDataNames(CaseSensitveSBufCompare) { + flags.case_insensitive = false; + flags.required = false; } void diff --git a/src/adaptation/icap/ServiceRep.cc b/src/adaptation/icap/ServiceRep.cc index e7b95620cc..506a62ab7a 100644 --- a/src/adaptation/icap/ServiceRep.cc +++ b/src/adaptation/icap/ServiceRep.cc @@ -33,6 +33,7 @@ CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Icap, ServiceRep); Adaptation::Icap::ServiceRep::ServiceRep(const ServiceConfigPointer &svcCfg): AsyncJob("Adaptation::Icap::ServiceRep"), Adaptation::Service(svcCfg), + sslContext(NULL), #if USE_OPENSSL sslSession(NULL), #endif diff --git a/src/cbdata.cc b/src/cbdata.cc index ad3c2e9aa1..a24effd015 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -81,6 +81,7 @@ public: cbdata() : valid(0), locks(0), + type(CBDATA_UNKNOWN), #if USE_CBDATA_DEBUG file(NULL), line(0), diff --git a/src/clientStream.cc b/src/clientStream.cc index e0ca21e595..08d8a7cca1 100644 --- a/src/clientStream.cc +++ b/src/clientStream.cc @@ -83,6 +83,7 @@ CBDATA_CLASS_INIT(clientStreamNode); clientStreamNode::clientStreamNode(CSR * aReadfunc, CSCB * aCallback, CSD * aDetach, CSS * aStatus, ClientStreamData aData) : + head(NULL), readfunc(aReadfunc), callback(aCallback), detach(aDetach), diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 4737a4c7d7..008ce87b72 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -73,8 +73,26 @@ clientReplyContext::~clientReplyContext() HTTPMSGUNLOCK(reply); } -clientReplyContext::clientReplyContext(ClientHttpRequest *clientContext) : http (cbdataReference(clientContext)), old_entry (NULL), old_sc(NULL), deleting(false) -{} +clientReplyContext::clientReplyContext(ClientHttpRequest *clientContext) : + purgeStatus(Http::scNone), + lookingforstore(0), + http(cbdataReference(clientContext)), + headers_sz(-1), + sc(NULL), + old_reqsize(0), + reqsize(0), + reqofs(0), +#if USE_CACHE_DIGESTS + lookup_type(NULL), +#endif + ourNode(NULL), + reply(NULL), + old_entry(NULL), + old_sc(NULL), + deleting(false) +{ + *tempbuf = 0; +} /** Create an error in the store awaiting the client side to read it. * diff --git a/src/client_side_reply.h b/src/client_side_reply.h index bafe4d3ca1..25b83a2a9e 100644 --- a/src/client_side_reply.h +++ b/src/client_side_reply.h @@ -83,17 +83,17 @@ public: int old_reqsize; /* ... again, for the buffer */ size_t reqsize; size_t reqofs; - char tempbuf[HTTP_REQBUF_SZ]; /* a temporary buffer if we need working storage */ + char tempbuf[HTTP_REQBUF_SZ]; ///< a temporary buffer if we need working storage #if USE_CACHE_DIGESTS const char *lookup_type; /* temporary hack: storeGet() result: HIT/MISS/NONE */ #endif - struct { + struct Flags { + Flags() : storelogiccomplete(0), complete(0), headersSent(false) {} unsigned storelogiccomplete:1; - - unsigned complete:1; /* we have read all we can from upstream */ + unsigned complete:1; ///< we have read all we can from upstream bool headersSent; } flags; clientStreamNode *ourNode; /* This will go away if/when this file gets refactored some more */ diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 502939236c..551b7a5a9c 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -112,20 +112,33 @@ ClientRequestContext::~ClientRequestContext() cbdataReferenceDone(http); delete error; - debugs(85,3, HERE << this << " ClientRequestContext destructed"); + debugs(85,3, "ClientRequestContext destructed, this=" << this); } -ClientRequestContext::ClientRequestContext(ClientHttpRequest *anHttp) : http(cbdataReference(anHttp)), acl_checklist (NULL), redirect_state (REDIRECT_NONE), store_id_state(REDIRECT_NONE),error(NULL), readNextRequest(false) -{ - http_access_done = false; - redirect_done = false; - store_id_done = false; - no_cache_done = false; - interpreted_req_hdrs = false; +ClientRequestContext::ClientRequestContext(ClientHttpRequest *anHttp) : + http(cbdataReference(anHttp)), + acl_checklist(NULL), + redirect_state(REDIRECT_NONE), + store_id_state(REDIRECT_NONE), + host_header_verify_done(false), + http_access_done(false), + adapted_http_access_done(false), +#if USE_ADAPTATION + adaptation_acl_check_done(false), +#endif + redirect_done(false), + store_id_done(false), + no_cache_done(false), + interpreted_req_hdrs(false), + tosToClientDone(false), + nfmarkToClientDone(false), #if USE_OPENSSL - sslBumpCheckDone = false; + sslBumpCheckDone(false), #endif - debugs(85,3, HERE << this << " ClientRequestContext constructed"); + error(NULL), + readNextRequest(false) +{ + debugs(85, 3, "ClientRequestContext constructed, this=" << this); } CBDATA_CLASS_INIT(ClientHttpRequest); @@ -134,7 +147,23 @@ ClientHttpRequest::ClientHttpRequest(ConnStateData * aConn) : #if USE_ADAPTATION AsyncJob("ClientHttpRequest"), #endif - loggingEntry_(NULL) + request(NULL), + uri(NULL), + log_uri(NULL), + req_sz(0), + logType(LOG_TAG_NONE), + calloutContext(NULL), + maxReplyBodySize_(0), + entry_(NULL), + loggingEntry_(NULL), + conn_(NULL) +#if USE_OPENSSL + , sslBumpNeed_(Ssl::bumpEnd) +#endif +#if USE_ADAPTATION + , request_satisfaction_mode(false) + , request_satisfaction_offset(0) +#endif { setConn(aConn); al = new AccessLogEntry; @@ -150,12 +179,6 @@ ClientHttpRequest::ClientHttpRequest(ConnStateData * aConn) : } #endif dlinkAdd(this, &active, &ClientActiveRequests); -#if USE_ADAPTATION - request_satisfaction_mode = false; -#endif -#if USE_OPENSSL - sslBumpNeed_ = Ssl::bumpEnd; -#endif } /* diff --git a/src/client_side_request.h b/src/client_side_request.h index 6364521e96..0016758282 100644 --- a/src/client_side_request.h +++ b/src/client_side_request.h @@ -72,7 +72,9 @@ public: char *log_uri; String store_id; /* StoreID for transactions where the request member is nil */ - struct { + struct Out { + Out() : offset(0), size(0), headers_sz(0) {} + int64_t offset; int64_t size; size_t headers_sz; @@ -87,16 +89,18 @@ public: AccessLogEntry::Pointer al; ///< access.log entry - struct { + struct Flags { + Flags() : accel(false), internal(false), done_copying(false), purging(false) {} + bool accel; - //bool intercepted; //XXX: it's apparently never used. - //bool spoof_client_ip; //XXX: it's apparently never used. bool internal; bool done_copying; bool purging; } flags; - struct { + struct Redirect { + Redirect() : status(Http::scNone), location(NULL) {} + Http::StatusCode status; char *location; } redirect; diff --git a/src/event.cc b/src/event.cc index 534d62a0f2..f76f28b7c1 100644 --- a/src/event.cc +++ b/src/event.cc @@ -88,10 +88,14 @@ EventDialer::print(std::ostream &os) const os << ')'; } -ev_entry::ev_entry(char const * aName, EVH * aFunction, void * aArgument, double evWhen, - int aWeight, bool haveArgument) : name(aName), func(aFunction), - arg(haveArgument ? cbdataReference(aArgument) : aArgument), when(evWhen), weight(aWeight), - cbdata(haveArgument) +ev_entry::ev_entry(char const * aName, EVH * aFunction, void * aArgument, double evWhen, int aWeight, bool haveArg) : + name(aName), + func(aFunction), + arg(haveArg ? cbdataReference(aArgument) : aArgument), + when(evWhen), + weight(aWeight), + cbdata(haveArg), + next(NULL) { } diff --git a/src/external_acl.cc b/src/external_acl.cc index 116b19e32d..73fa16c08a 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -151,6 +151,7 @@ public: CBDATA_CLASS_INIT(external_acl); external_acl::external_acl() : + next(NULL), ttl(DEFAULT_EXTERNAL_ACL_TTL), negative_ttl(-1), grace(1), diff --git a/src/fs/rock/RockIoState.cc b/src/fs/rock/RockIoState.cc index 94c627a11d..0249140d09 100644 --- a/src/fs/rock/RockIoState.cc +++ b/src/fs/rock/RockIoState.cc @@ -26,7 +26,8 @@ Rock::IoState::IoState(Rock::SwapDir::Pointer &aDir, StoreEntry *anEntry, StoreIOState::STFNCB *cbFile, StoreIOState::STIOCB *cbIo, - void *data): + void *data) : + StoreIOState(cbFile, cbIo, data), readableAnchor_(NULL), writeableAnchor_(NULL), sidCurrent(-1), @@ -38,9 +39,6 @@ Rock::IoState::IoState(Rock::SwapDir::Pointer &aDir, e = anEntry; e->lock("rock I/O"); // anchor, swap_filen, and swap_dirn are set by the caller - file_callback = cbFile; - callback = cbIo; - callback_data = cbdataReference(data); ++store_open_disk_fd; // TODO: use a dedicated counter? //theFile is set by SwapDir because it depends on DiskIOStrategy } diff --git a/src/fs/ufs/RebuildState.cc b/src/fs/ufs/RebuildState.cc index 2609d43ded..b5d1b75951 100644 --- a/src/fs/ufs/RebuildState.cc +++ b/src/fs/ufs/RebuildState.cc @@ -29,8 +29,24 @@ CBDATA_NAMESPACED_CLASS_INIT(Fs::Ufs,RebuildState); Fs::Ufs::RebuildState::RebuildState(RefCount aSwapDir) : - sd (aSwapDir), LogParser(NULL), e(NULL), fromLog(true), _done (false) + sd(aSwapDir), + n_read(0), + LogParser(NULL), + curlvl1(0), + curlvl2(0), + in_dir(0), + done(0), + fn(0), + entry(NULL), + td(NULL), + e(NULL), + fromLog(true), + _done(false), + cbdata(NULL) { + *fullpath = 0; + *fullfilename = 0; + /* * If the swap.state file exists in the cache_dir, then * we'll use commonUfsDirRebuildFromSwapLog(), otherwise we'll @@ -433,6 +449,7 @@ Fs::Ufs::RebuildState::getNextFile(sfileno * filn_p, int *) fd = -1; if (!flags.init) { /* initialize, open first file */ + // XXX: 0's should not be needed, constructor inits now done = 0; curlvl1 = 0; curlvl2 = 0; diff --git a/src/fs/ufs/StoreSearchUFS.cc b/src/fs/ufs/StoreSearchUFS.cc index 9707bdb09d..ba73d859a6 100644 --- a/src/fs/ufs/StoreSearchUFS.cc +++ b/src/fs/ufs/StoreSearchUFS.cc @@ -16,8 +16,11 @@ CBDATA_NAMESPACED_CLASS_INIT(Fs::Ufs,StoreSearchUFS); Fs::Ufs::StoreSearchUFS::StoreSearchUFS(RefCount aSwapDir) : - sd(aSwapDir), walker (sd->repl->WalkInit(sd->repl)), - current (NULL), _done (false) + sd(aSwapDir), + walker(sd->repl->WalkInit(sd->repl)), + cbdata(NULL), + current(NULL), + _done(false) {} Fs::Ufs::StoreSearchUFS::~StoreSearchUFS() diff --git a/src/fs/ufs/UFSStoreState.cc b/src/fs/ufs/UFSStoreState.cc index 55cf826eeb..76ef4d9be2 100644 --- a/src/fs/ufs/UFSStoreState.cc +++ b/src/fs/ufs/UFSStoreState.cc @@ -321,14 +321,23 @@ Fs::Ufs::UFSStoreState::doCloseCallback(int errflag) /* ============= THE REAL UFS CODE ================ */ -Fs::Ufs::UFSStoreState::UFSStoreState(SwapDir * SD, StoreEntry * anEntry, STIOCB * callback_, void *callback_data_) : opening (false), creating (false), closing (false), reading(false), writing(false), pending_reads(NULL), pending_writes (NULL) +Fs::Ufs::UFSStoreState::UFSStoreState(SwapDir * SD, StoreEntry * anEntry, STIOCB * cbIo, void *data) : + StoreIOState(NULL, cbIo, data), + opening(false), + creating(false), + closing(false), + reading(false), + writing(false), + pending_reads(NULL), + pending_writes(NULL), + read_buf(NULL) { + // StoreIOState inherited members swap_filen = anEntry->swap_filen; swap_dirn = SD->index; - mode = O_BINARY; - callback = callback_; - callback_data = cbdataReference(callback_data_); e = anEntry; + + // our flags flags.write_draining = false; flags.try_closing = false; } diff --git a/src/fs/ufs/UFSStoreState.h b/src/fs/ufs/UFSStoreState.h index d3d05c78aa..fcfbdf4648 100644 --- a/src/fs/ufs/UFSStoreState.h +++ b/src/fs/ufs/UFSStoreState.h @@ -48,23 +48,25 @@ protected: { MEMPROXY_CLASS(UFSStoreState::_queued_read); public: + _queued_read() : buf(NULL), size(0), offset(0), callback(NULL), callback_data(NULL) {} + char *buf; size_t size; off_t offset; STRCB *callback; void *callback_data; - }; class _queued_write { MEMPROXY_CLASS(UFSStoreState::_queued_write); public: + _queued_write() : buf(NULL), size(0), offset(0), free_func(NULL) {} + char const *buf; size_t size; off_t offset; FREE *free_func; - }; /** \todo These should be in the IO strategy */ diff --git a/src/ip/QosConfig.h b/src/ip/QosConfig.h index 62eaca313a..0cb1253164 100644 --- a/src/ip/QosConfig.h +++ b/src/ip/QosConfig.h @@ -29,7 +29,7 @@ class acl_tos CBDATA_CLASS(acl_tos); public: - acl_tos() : next(NULL), aclList(NULL) {} + acl_tos() : next(NULL), aclList(NULL), tos(0) {} ~acl_tos(); acl_tos *next; @@ -43,7 +43,7 @@ class acl_nfmark CBDATA_CLASS(acl_nfmark); public: - acl_nfmark() : next(NULL), aclList(NULL) {} + acl_nfmark() : next(NULL), aclList(NULL), nfmark(0) {} ~acl_nfmark(); acl_nfmark *next; diff --git a/src/pconn.cc b/src/pconn.cc index 248b1ca898..50f17b8326 100644 --- a/src/pconn.cc +++ b/src/pconn.cc @@ -37,6 +37,7 @@ IdleConnList::IdleConnList(const char *key, PconnPool *thePool) : parent_(thePool) { hash.key = xstrdup(key); + hash.next = NULL; theList_ = new Comm::ConnectionPointer[capacity_]; // TODO: re-attach to MemPools. WAS: theList = (?? *)pconn_fds_pool->alloc(); } diff --git a/src/ssl/PeerConnector.h b/src/ssl/PeerConnector.h index a36e02da08..95266d990b 100644 --- a/src/ssl/PeerConnector.h +++ b/src/ssl/PeerConnector.h @@ -248,7 +248,6 @@ private: Comm::ConnectionPointer clientConn; ///< TCP connection to the client AsyncCall::Pointer callback; ///< we call this with the results AsyncCall::Pointer closeHandler; ///< we call this when the connection closed - time_t startTime; ///< when the peer connector negotiation started bool splice; ///< whether we are going to splice or not bool resumingSession; ///< whether it is an SSL resuming session connection bool serverCertificateHandled; ///< whether handleServerCertificate() succeeded diff --git a/src/store_client.cc b/src/store_client.cc index fd677f2887..08843bad50 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -146,27 +146,25 @@ storeClientCopyEvent(void *data) storeClientCopy2(sc->entry, sc); } -store_client::store_client(StoreEntry *e) : entry (e) -#if USE_DELAY_POOLS - , delayId() +store_client::store_client(StoreEntry *e) : + cmp_offset(0), +#if STORE_CLIENT_LIST_DEBUG + owner(cbdataReference(data)), #endif - , type (e->storeClientType()) - , object_ok(true) + entry(e), + type(e->storeClientType()), + object_ok(true) { - cmp_offset = 0; flags.disk_io_pending = false; + flags.store_copying = false; + flags.copy_event_pending = false; ++ entry->refcount; - if (getType() == STORE_DISK_CLIENT) + if (getType() == STORE_DISK_CLIENT) { /* assert we'll be able to get the data we want */ /* maybe we should open swapin_sio here */ assert(entry->swap_filen > -1 || entry->swappingOut()); - -#if STORE_CLIENT_LIST_DEBUG - - owner = cbdataReference(data); - -#endif + } } store_client::~store_client()