]>
Commit | Line | Data |
---|---|---|
2087dca6 | 1 | #ifndef SQUID_FORWARD_H |
2 | #define SQUID_FORWARD_H | |
3cd1350a | 3 | |
4 | class FwdServer | |
5 | { | |
6 | ||
7 | public: | |
8 | peer *_peer; /* NULL --> origin server */ | |
9 | hier_code code; | |
10 | FwdServer *next; | |
11 | }; | |
12 | ||
13 | class FwdState : public RefCountable | |
14 | { | |
15 | ||
16 | public: | |
17 | typedef RefCount<FwdState> Pointer; | |
18 | FwdState(int fd, StoreEntry *, HttpRequest *); | |
19 | ~FwdState(); | |
20 | static void initModule(); | |
21 | ||
be0c6690 | 22 | static void fwdStart(int fd, StoreEntry *, HttpRequest *); |
3cd1350a | 23 | void startComplete(FwdServer *); |
24 | void startFail(); | |
25 | void fail(ErrorState *err); | |
26 | void unregister(int fd); | |
27 | void complete(); | |
28 | int reforward(); | |
29 | bool reforwardableStatus(http_status s); | |
30 | void serverClosed(int fd); | |
31 | void connectStart(); | |
32 | void connectDone(int server_fd, comm_err_t status, int xerrno); | |
33 | void connectTimeout(int fd); | |
34 | void initiateSSL(); | |
35 | void negotiateSSL(int fd); | |
36 | bool checkRetry(); | |
37 | bool checkRetriable(); | |
38 | void dispatch(); | |
39 | void pconnPush(int fd, const char *host, int port, const char *domain); | |
40 | ||
41 | bool dontRetry() { return flags.dont_retry; } | |
42 | ||
43 | void dontRetry(bool val) { flags.dont_retry = val; } | |
44 | ||
45 | bool ftpPasvFailed() { return flags.ftp_pasv_failed; } | |
46 | ||
47 | void ftpPasvFailed(bool val) { flags.ftp_pasv_failed = val; } | |
48 | ||
49 | static void serversFree(FwdServer **); | |
50 | ||
51 | private: | |
52 | static void logReplyStatus(int tries, http_status status); | |
53 | ||
54 | #if WIP_FWD_LOG | |
55 | ||
56 | void uninit | |
57 | static void logRotate | |
58 | void status() | |
59 | #endif | |
60 | ||
61 | public: | |
62 | StoreEntry *entry; | |
63 | HttpRequest *request; | |
64 | int server_fd; | |
65 | FwdServer *servers; | |
66 | ||
67 | private: | |
68 | CBDATA_CLASS2(FwdState); | |
69 | Pointer self; | |
70 | ErrorState *err; | |
71 | int client_fd; | |
72 | time_t start_t; | |
73 | int n_tries; | |
74 | int origin_tries; | |
75 | #if WIP_FWD_LOG | |
76 | ||
77 | http_status last_status; | |
78 | #endif | |
79 | ||
80 | struct | |
81 | { | |
82 | ||
83 | unsigned int dont_retry: | |
84 | 1; | |
85 | ||
86 | unsigned int ftp_pasv_failed: | |
87 | 1; | |
88 | } | |
89 | ||
90 | flags; | |
91 | ||
92 | }; | |
2087dca6 | 93 | |
94 | #endif |