]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/StoreToCommWriter.h
4 * DEBUG: section 16 Cache Manager API
8 #ifndef SQUID_MGR_STORE_TO_COMM_WRITER_H
9 #define SQUID_MGR_STORE_TO_COMM_WRITER_H
11 #include "base/AsyncJob.h"
12 #include "mgr/Action.h"
13 #include "StoreIOBuffer.h"
18 class CommCloseCbParams
;
23 /// manages receive-from-store, write-to-comm, receive-... sequence
24 /// for the given StoreEntry and client FD
25 class StoreToCommWriter
: public AsyncJob
28 StoreToCommWriter(int aFd
, StoreEntry
*anEntry
);
29 virtual ~StoreToCommWriter();
34 virtual void swanSong();
35 virtual bool doneAll() const;
37 /// request more action results from the store
38 void scheduleStoreCopy();
39 /// receive some action results from the store
40 void noteStoreCopied(StoreIOBuffer ioBuf
);
41 static void NoteStoreCopied(void* data
, StoreIOBuffer ioBuf
);
42 /// called by Store if the entry is no longer usable
43 static void Abort(void* param
);
45 /// tell Comm to write action results
46 void scheduleCommWrite(const StoreIOBuffer
& ioBuf
);
47 /// called by Comm after the action results are written
48 void noteCommWrote(const CommIoCbParams
& params
);
49 /// called by Comm if the client socket got closed
50 void noteCommClosed(const CommCloseCbParams
& params
);
52 /// closes the local connection to the HTTP client, if any
56 int fd
; ///< HTTP client descriptor
58 StoreEntry
* entry
; ///< store entry with the cache manager response
59 store_client
* sc
; ///< our registration with the store
60 int64_t writeOffset
; ///< number of bytes written to the client
62 AsyncCall::Pointer closer
; ///< comm_close handler
63 char buffer
[HTTP_REQBUF_SZ
]; ///< action results; Store fills, Comm writes
65 CBDATA_CLASS2(StoreToCommWriter
);
70 #endif /* SQUID_MGR_STORE_TO_COMM_WRITER_H */