~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to src/adaptation/ecap/XactionRep.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2009-09-24 14:51:06 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (20.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090924145106-38jgrzmj0d73pha5
Tags: 3.1.0.13-1
* Upload to experimental

* New upstream release
  - Fixes Follow-X-Forwarded-For support (Closes: #523943)
  - Adds IPv6 support (Closes: #432351)

* debian/rules
  - Removed obsolete configuration options
  - Enable db and radius basic authentication modules

* debian/patches/01-cf.data.debian
  - Adapted to new upstream version

* debian/patches/02-makefile-defaults
  - Adapted to new upstream version

* debian/{squid.postinst,squid.rc,README.Debian,watch}
  - Updated references to squid 3.1

* debian/squid3.install
  - Install CSS file for error pages
  - Install manual pages for new authentication modules

* debian/squid3-common.install
  - Install documented version of configuration file in /usr/share/doc/squid3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 * $Id$
 
4
 */
 
5
 
 
6
#ifndef SQUID_ECAP_XACTION_REP_H
 
7
#define SQUID_ECAP_XACTION_REP_H
 
8
 
 
9
#include "BodyPipe.h"
 
10
#include "adaptation/Initiate.h"
 
11
#include "adaptation/Message.h"
 
12
#include "adaptation/ecap/MessageRep.h"
 
13
#include "adaptation/ecap/ServiceRep.h"
 
14
#include <libecap/common/forward.h>
 
15
#include <libecap/common/memory.h>
 
16
#include <libecap/host/xaction.h>
 
17
#include <libecap/adapter/xaction.h>
 
18
 
 
19
namespace Adaptation
 
20
{
 
21
namespace Ecap {
 
22
 
 
23
/* The eCAP xaction representative maintains information about a single eCAP
 
24
   xaction that Squid communicates with. One eCAP module may register many
 
25
   eCAP xactions. */
 
26
class XactionRep : public Adaptation::Initiate, public libecap::host::Xaction,
 
27
            public BodyConsumer, public BodyProducer
 
28
{
 
29
public:
 
30
    XactionRep(Adaptation::Initiator *anInitiator, HttpMsg *virginHeader, HttpRequest *virginCause, const Adaptation::ServicePointer &service);
 
31
    virtual ~XactionRep();
 
32
 
 
33
    typedef libecap::shared_ptr<libecap::adapter::Xaction> AdapterXaction;
 
34
    void master(const AdapterXaction &aMaster); // establish a link
 
35
 
 
36
    // libecap::host::Xaction API
 
37
    virtual libecap::Message &virgin();
 
38
    virtual const libecap::Message &cause();
 
39
    virtual libecap::Message &adapted();
 
40
    virtual void useVirgin();
 
41
    virtual void useAdapted(const libecap::shared_ptr<libecap::Message> &msg);
 
42
    virtual void adaptationDelayed(const libecap::Delay &);
 
43
    virtual void adaptationAborted();
 
44
    virtual void vbDiscard();
 
45
    virtual void vbMake();
 
46
    virtual void vbStopMaking();
 
47
    virtual void vbMakeMore();
 
48
    virtual libecap::Area vbContent(libecap::size_type offset, libecap::size_type size);
 
49
    virtual void vbContentShift(libecap::size_type size);
 
50
    virtual void noteAbContentDone(bool atEnd);
 
51
    virtual void noteAbContentAvailable();
 
52
 
 
53
    // libecap::Callable API, via libecap::host::Xaction
 
54
    virtual bool callable() const;
 
55
 
 
56
    // BodyProducer API
 
57
    virtual void noteMoreBodySpaceAvailable(RefCount<BodyPipe> bp);
 
58
    virtual void noteBodyConsumerAborted(RefCount<BodyPipe> bp);
 
59
 
 
60
    // BodyConsumer API
 
61
    virtual void noteMoreBodyDataAvailable(RefCount<BodyPipe> bp);
 
62
    virtual void noteBodyProductionEnded(RefCount<BodyPipe> bp);
 
63
    virtual void noteBodyProducerAborted(RefCount<BodyPipe> bp);
 
64
 
 
65
    //  Initiate API
 
66
    virtual void noteInitiatorAborted();
 
67
 
 
68
    // AsyncJob API (via Initiate)
 
69
    virtual void start();
 
70
    virtual bool doneAll() const;
 
71
    virtual void swanSong();
 
72
    virtual const char *status() const;
 
73
 
 
74
protected:
 
75
    Service &service();
 
76
 
 
77
    Adaptation::Message &answer();
 
78
 
 
79
    void dropVirgin(const char *reason);
 
80
    void moveAbContent();
 
81
 
 
82
    void terminateMaster();
 
83
    void scheduleStop(const char *reason);
 
84
 
 
85
private:
 
86
    AdapterXaction theMaster; // the actual adaptation xaction we represent
 
87
    Adaptation::ServicePointer theService; ///< xaction's adaptation service
 
88
 
 
89
    MessageRep theVirginRep;
 
90
    MessageRep *theCauseRep;
 
91
 
 
92
    typedef libecap::shared_ptr<libecap::Message> MessagePtr;
 
93
    MessagePtr theAnswerRep;
 
94
 
 
95
    typedef enum { opUndecided, opOn, opComplete, opNever } OperationState;
 
96
    OperationState proxyingVb; // delivering virgin body from core to adapter
 
97
    OperationState proxyingAb; // delivering adapted body from adapter to core
 
98
    int adaptHistoryId;        ///< adaptation history slot reservation
 
99
    bool canAccessVb;          // virgin BodyPipe content is accessible
 
100
    bool abProductionFinished; // whether adapter has finished producing ab
 
101
    bool abProductionAtEnd;    // whether adapter produced a complete ab
 
102
 
 
103
    CBDATA_CLASS2(XactionRep);
 
104
};
 
105
 
 
106
} // namespace Ecap
 
107
} // namespace Adaptation
 
108
 
 
109
#endif /* SQUID_ECAP_XACTION_REP_H */