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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors