OptXact.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 #ifndef SQUID_ICAPOPTXACT_H
10 #define SQUID_ICAPOPTXACT_H
11 
14 
15 namespace Adaptation
16 {
17 namespace Icap
18 {
19 
20 /* OptXact sends an ICAP OPTIONS request to the ICAP service,
21  * parses the ICAP response, and sends it to the initiator. A NULL response
22  * means the ICAP service could not be contacted or did not return any
23  * valid response. */
24 
25 class OptXact: public Xaction
26 {
28 
29 public:
30  OptXact(ServiceRep::Pointer &aService);
31 
32 protected:
33  /* Xaction API */
34  virtual void start();
35  virtual void startShoveling();
36  virtual void handleCommWrote(size_t size);
37  virtual void handleCommRead(size_t size);
38 
39  void makeRequest(MemBuf &buf);
40  bool parseResponse();
41 
42  void startReading();
43  virtual bool doneReading() const { return commEof || readAll; }
44 
45  virtual void swanSong();
46 
47 private:
48  virtual void finalizeLogInfo();
49 
50  bool readAll;
51 };
52 
53 // An Launcher that stores OptXact construction info and
54 // creates OptXact when needed
56 {
58 
59 public:
61 
62 protected:
63  virtual Xaction *createXaction();
64 };
65 
66 } // namespace Icap
67 } // namespace Adaptation
68 
69 #endif /* SQUID_ICAPOPTXACT_H */
70 
virtual Xaction * createXaction()
Definition: OptXact.cc:145
virtual void handleCommRead(size_t size)
Definition: OptXact.cc:82
OptXactLauncher(Adaptation::ServicePointer aService)
Definition: OptXact.cc:139
virtual void startShoveling()
starts sending/receiving ICAP messages
Definition: OptXact.cc:39
OptXact(ServiceRep::Pointer &aService)
Definition: OptXact.cc:25
void makeRequest(MemBuf &buf)
Definition: OptXact.cc:52
bool readAll
read the entire OPTIONS response
Definition: OptXact.h:50
virtual void start()
called by AsyncStart; do not call directly
Definition: OptXact.cc:32
int size
Definition: ModDevPoll.cc:75
virtual void handleCommWrote(size_t size)
Definition: OptXact.cc:75
Definition: MemBuf.h:24
virtual bool doneReading() const
Definition: OptXact.h:43
virtual void swanSong()
Definition: OptXact.cc:121
virtual void finalizeLogInfo()
Definition: OptXact.cc:126

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors