]> git.ipfire.org Git - thirdparty/squid.git/blame - src/StoreIOState.cc
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / StoreIOState.cc
CommitLineData
d3b3ab85 1/*
5b74111a 2 * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
d3b3ab85 3 *
bbc27441
AJ
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
d3b3ab85 7 */
8
bbc27441
AJ
9/* DEBUG: section 20 Swap Dir base object */
10
582c2af2
FC
11#include "squid.h"
12#include "Debug.h"
13#include "defines.h"
abf396ec 14#include "Store.h"
d3b3ab85 15#include "StoreIOState.h"
62e76326 16
d3b3ab85 17void *
ced8def3 18StoreIOState::operator new (size_t)
d3b3ab85 19{
20 assert(0);
21 return (void *)1;
22}
23
62e76326 24void
ced8def3
AJ
25StoreIOState::operator delete (void *)
26{
27 assert(0);
28}
d3b3ab85 29
cc8c4af2
AJ
30StoreIOState::StoreIOState(StoreIOState::STFNCB *cbFile, StoreIOState::STIOCB *cbIo, void *data) :
31 swap_dirn(-1),
32 swap_filen(-1),
33 e(NULL),
34 mode(O_BINARY),
35 offset_(0),
36 file_callback(cbFile),
37 callback(cbIo),
38 callback_data(cbdataReference(data))
d3b3ab85 39{
3555cbff
FC
40 read.callback = NULL;
41 read.callback_data = NULL;
42 flags.closing = false;
d3b3ab85 43}
44
e877aaac 45StoreIOState::~StoreIOState()
d3b3ab85 46{
7fbb6b8f 47 debugs(20,3, "StoreIOState::~StoreIOState: " << this);
48
d3b3ab85 49 if (read.callback_data)
62e76326 50 cbdataReferenceDone(read.callback_data);
51
d3b3ab85 52 if (callback_data)
62e76326 53 cbdataReferenceDone(callback_data);
d3b3ab85 54}
f53969cc 55
abf396ec
AR
56bool StoreIOState::touchingStoreEntry() const
57{
58 return e && e->swap_filen == swap_filen;
59}
60