From: wessels <> Date: Wed, 4 Jan 2006 00:27:21 +0000 (+0000) Subject: Added forward.h when converting FwdState to a C++ class X-Git-Tag: SQUID_3_0_PRE4~398 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3cd1350aa71678403147391f412196b0dca94d17;p=thirdparty%2Fsquid.git Added forward.h when converting FwdState to a C++ class --- diff --git a/src/forward.h b/src/forward.h new file mode 100644 index 0000000000..45821cc01b --- /dev/null +++ b/src/forward.h @@ -0,0 +1,90 @@ + +class FwdServer +{ + +public: + peer *_peer; /* NULL --> origin server */ + hier_code code; + FwdServer *next; +}; + +class FwdState : public RefCountable +{ + +public: + typedef RefCount Pointer; + FwdState(int fd, StoreEntry *, HttpRequest *); + ~FwdState(); + static void initModule(); + + static void fwdStart(int fd, StoreEntry *, HttpRequest *); + void startComplete(FwdServer *); + void startFail(); + void fail(ErrorState *err); + void unregister(int fd); + void complete(); + int reforward(); + bool reforwardableStatus(http_status s); + void serverClosed(int fd); + void connectStart(); + void connectDone(int server_fd, comm_err_t status, int xerrno); + void connectTimeout(int fd); + void initiateSSL(); + void negotiateSSL(int fd); + bool checkRetry(); + bool checkRetriable(); + void dispatch(); + void pconnPush(int fd, const char *host, int port, const char *domain); + + bool dontRetry() { return flags.dont_retry; } + + void dontRetry(bool val) { flags.dont_retry = val; } + + bool ftpPasvFailed() { return flags.ftp_pasv_failed; } + + void ftpPasvFailed(bool val) { flags.ftp_pasv_failed = val; } + + static void serversFree(FwdServer **); + +private: + static void logReplyStatus(int tries, http_status status); + +#if WIP_FWD_LOG + + void uninit + static void logRotate + void status() +#endif + +public: + StoreEntry *entry; + HttpRequest *request; + int server_fd; + FwdServer *servers; + +private: + CBDATA_CLASS2(FwdState); + Pointer self; + ErrorState *err; + int client_fd; + time_t start_t; + int n_tries; + int origin_tries; +#if WIP_FWD_LOG + + http_status last_status; +#endif + + struct + { + +unsigned int dont_retry: + 1; + +unsigned int ftp_pasv_failed: + 1; + } + + flags; + +};