StoreToCommWriter.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 /* DEBUG: section 16 Cache Manager API */
10 
11 #ifndef SQUID_MGR_STORE_TO_COMM_WRITER_H
12 #define SQUID_MGR_STORE_TO_COMM_WRITER_H
13 
14 #include "base/AsyncJob.h"
15 #include "comm/forward.h"
16 #include "mgr/Action.h"
17 #include "StoreIOBuffer.h"
18 
19 class store_client;
20 class CommIoCbParams;
21 class CommCloseCbParams;
22 
23 namespace Mgr
24 {
25 
29 {
31 
32 public:
34  virtual ~StoreToCommWriter();
35 
36 protected:
37  /* AsyncJob API */
38  virtual void start();
39  virtual void swanSong();
40  virtual bool doneAll() const;
41 
43  void scheduleStoreCopy();
45  void noteStoreCopied(StoreIOBuffer ioBuf);
46  static void NoteStoreCopied(void* data, StoreIOBuffer ioBuf);
48  static void Abort(void* param);
49 
51  void scheduleCommWrite(const StoreIOBuffer& ioBuf);
53  void noteCommWrote(const CommIoCbParams& params);
55  void noteCommClosed(const CommCloseCbParams& params);
56 
58  void close();
59 
60 protected:
62 
65  int64_t writeOffset;
66 
69 };
70 
71 } // namespace Mgr
72 
73 #endif /* SQUID_MGR_STORE_TO_COMM_WRITER_H */
74 
#define HTTP_REQBUF_SZ
Definition: defines.h:216
Comm::ConnectionPointer clientConnection
HTTP client descriptor.
static void NoteStoreCopied(void *data, StoreIOBuffer ioBuf)
int conn
the current server connection FD
Definition: Transport.cc:26
void noteStoreCopied(StoreIOBuffer ioBuf)
receive some action results from the store
void const char HLPCB void * data
Definition: stub_helper.cc:16
char buffer[HTTP_REQBUF_SZ]
action results; Store fills, Comm writes
void noteCommClosed(const CommCloseCbParams &params)
called by Comm if the client socket got closed
StoreEntry * entry
store entry with the cache manager response
int64_t writeOffset
number of bytes written to the client
virtual bool doneAll() const
whether positive goal has been reached
void noteCommWrote(const CommIoCbParams &params)
called by Comm after the action results are written
void scheduleCommWrite(const StoreIOBuffer &ioBuf)
tell Comm to write action results
StoreToCommWriter(const Comm::ConnectionPointer &conn, StoreEntry *anEntry)
AsyncCall::Pointer closer
comm_close handler
CBDATA_CLASS(StoreToCommWriter)
store_client * sc
our registration with the store
void close()
closes the local connection to the HTTP client, if any
static void Abort(void *param)
called by Store if the entry is no longer usable
virtual void start()
called by AsyncStart; do not call directly
void scheduleStoreCopy()
request more action results from the store

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors