]>
Commit | Line | Data |
---|---|---|
924f73bc | 1 | /* |
4ac4a490 | 2 | * Copyright (C) 1996-2017 The Squid Software Foundation and contributors |
924f73bc | 3 | * |
bbc27441 AJ |
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. | |
924f73bc | 7 | */ |
8 | ||
bbc27441 AJ |
9 | /* DEBUG: section 86 ESI processing */ |
10 | ||
924f73bc | 11 | #ifndef SQUID_ESIINCLUDE_H |
12 | #define SQUID_ESIINCLUDE_H | |
13 | ||
f99c2cfe | 14 | #include "esi/Context.h" |
582c2af2 FC |
15 | #include "esi/Element.h" |
16 | #include "esi/Segment.h" | |
924f73bc | 17 | |
18 | class ESIInclude; | |
19 | typedef RefCount<ESIInclude> ESIIncludePtr; | |
20 | ||
21 | class ESIStreamContext : public RefCountable | |
22 | { | |
5c2f68b7 | 23 | CBDATA_CLASS(ESIStreamContext); |
924f73bc | 24 | |
25 | public: | |
26 | typedef RefCount<ESIStreamContext> Pointer; | |
924f73bc | 27 | ESIStreamContext(); |
28 | ~ESIStreamContext(); | |
29 | void freeResources(); | |
30 | int finished; | |
31 | ESIIncludePtr include; | |
32 | ESISegment::Pointer localbuffer; | |
33 | ESISegment::Pointer buffer; | |
924f73bc | 34 | }; |
35 | ||
924f73bc | 36 | class ESIInclude : public ESIElement |
37 | { | |
b001e822 | 38 | MEMPROXY_CLASS(ESIInclude); |
924f73bc | 39 | |
741c2986 | 40 | public: |
924f73bc | 41 | ESIInclude(esiTreeParentPtr, int attributes, const char **attr, ESIContext *); |
42 | ~ESIInclude(); | |
43 | void render(ESISegment::Pointer); | |
44 | esiProcessResult_t process (int dovars); | |
45 | Pointer makeCacheable() const; | |
46 | Pointer makeUsable(esiTreeParentPtr, ESIVarState &) const; | |
47 | void subRequestDone (ESIStreamContext::Pointer, bool); | |
48 | ||
26ac0430 | 49 | struct { |
3d0ac046 HN |
50 | int onerrorcontinue:1; /* on error return zero data */ |
51 | int failed:1; /* Failed to process completely */ | |
52 | int finished:1; /* Finished getting subrequest data */ | |
53 | } flags; | |
924f73bc | 54 | ESIStreamContext::Pointer src; |
55 | ESIStreamContext::Pointer alt; | |
56 | ESISegment::Pointer srccontent; | |
57 | ESISegment::Pointer altcontent; | |
58 | ESIVarState *varState; | |
59 | char *srcurl, *alturl; | |
59a09b98 | 60 | void includeFail(ESIStreamContext::Pointer); |
924f73bc | 61 | void finish(); |
62 | ||
63 | private: | |
924f73bc | 64 | void Start (ESIStreamContext::Pointer, char const *, ESIVarState *); |
65 | esiTreeParentPtr parent; | |
66 | void start(); | |
67 | bool started; | |
68 | bool sent; | |
69 | ESIInclude(ESIInclude const &); | |
70 | bool dataNeeded() const; | |
71 | void prepareRequestHeaders(HttpHeader &tempheaders, ESIVarState *vars); | |
72 | }; | |
73 | ||
74 | #endif /* SQUID_ESIINCLUDE_H */ | |
f53969cc | 75 |