StoreToCommWriter.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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
20class store_client;
21class CommIoCbParams;
23
24namespace Mgr
25{
26
30{
32
33public:
35 ~StoreToCommWriter() override;
36
37protected:
38 /* AsyncJob API */
39 void start() override;
40 void swanSong() override;
41 bool doneAll() const override;
42
44 void scheduleStoreCopy();
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
61protected:
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
void start() override
called by AsyncStart; do not call directly
bool doneAll() const override
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
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
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