OptXact.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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  virtual void start();
34  virtual void handleCommConnected();
35  virtual void handleCommWrote(size_t size);
36  virtual void handleCommRead(size_t size);
37 
38  void makeRequest(MemBuf &buf);
39  bool parseResponse();
40 
41  void startReading();
42  virtual bool doneReading() const { return commEof || readAll; }
43 
44  virtual void swanSong();
45 
46 private:
47  virtual void finalizeLogInfo();
48 
49  bool readAll;
50 };
51 
52 // An Launcher that stores OptXact construction info and
53 // creates OptXact when needed
55 {
57 
58 public:
60 
61 protected:
62  virtual Xaction *createXaction();
63 };
64 
65 } // namespace Icap
66 } // namespace Adaptation
67 
68 #endif /* SQUID_ICAPOPTXACT_H */
69 
virtual void handleCommWrote(size_t size)
Definition: OptXact.cc:76
virtual void finalizeLogInfo()
Definition: OptXact.cc:127
virtual bool doneReading() const
Definition: OptXact.h:42
OptXactLauncher(Adaptation::ServicePointer aService)
Definition: OptXact.cc:140
virtual void handleCommConnected()
Definition: OptXact.cc:40
OptXact(ServiceRep::Pointer &aService)
Definition: OptXact.cc:26
void makeRequest(MemBuf &buf)
Definition: OptXact.cc:53
virtual Xaction * createXaction()
Definition: OptXact.cc:146
virtual void start()
called by AsyncStart; do not call directly
Definition: OptXact.cc:33
void const char * buf
Definition: stub_helper.cc:16
bool readAll
read the entire OPTIONS response
Definition: OptXact.h:49
Definition: MemBuf.h:23
virtual void handleCommRead(size_t size)
Definition: OptXact.cc:83
virtual void swanSong()
Definition: OptXact.cc:122
int size
Definition: ModDevPoll.cc:77

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors