]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/forward.h
1 #ifndef SQUID_FORWARD_H
2 #define SQUID_FORWARD_H
10 #include "IPAddress.h"
16 peer
*_peer
; /* NULL --> origin server */
21 class FwdState
: public RefCountable
25 typedef RefCount
<FwdState
> Pointer
;
27 static void initModule();
28 static void RegisterWithCacheManager(CacheManager
& manager
);
30 static void fwdStart(int fd
, StoreEntry
*, HttpRequest
*);
31 void startComplete(FwdServer
*);
33 void fail(ErrorState
*err
);
34 void unregister(int fd
);
36 void handleUnregisteredServerEnd();
38 bool reforwardableStatus(http_status s
);
39 void serverClosed(int fd
);
41 void connectDone(int server_fd
, comm_err_t status
, int xerrno
);
42 void connectTimeout(int fd
);
44 void negotiateSSL(int fd
);
46 bool checkRetriable();
48 void pconnPush(int fd
, const char *host
, int port
, const char *domain
, IPAddress
&client_addr
);
50 bool dontRetry() { return flags
.dont_retry
; }
52 void dontRetry(bool val
) { flags
.dont_retry
= val
; }
54 bool ftpPasvFailed() { return flags
.ftp_pasv_failed
; }
56 void ftpPasvFailed(bool val
) { flags
.ftp_pasv_failed
= val
; }
58 static void serversFree(FwdServer
**);
61 // hidden for safer management of self; use static fwdStart
62 FwdState(int fd
, StoreEntry
*, HttpRequest
*);
63 void start(Pointer aSelf
);
65 static void logReplyStatus(int tries
, http_status status
);
66 void updateHierarchyInfo();
72 void uninit
/**DOCS_NOSEMI*/
73 static void logRotate
/**DOCS_NOSEMI*/
74 void status() /**DOCS_NOSEMI*/
82 static void abort(void*);
85 CBDATA_CLASS2(FwdState
);
94 http_status last_status
;
99 unsigned int dont_retry
:1;
100 unsigned int ftp_pasv_failed
:1;
101 unsigned int forward_completed
:1;
104 IPAddress src
; /* Client address for this connection. Needed for transparent operations. */