]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/forward.h
1 #ifndef SQUID_FORWARD_H
2 #define SQUID_FORWARD_H
10 #include "hier_code.h"
11 #include "ip/Address.h"
14 * Returns the TOS value that we should be setting on the connection
15 * to the server, based on the ACL.
17 tos_t
GetTosToServer(HttpRequest
* request
);
20 * Returns the Netfilter mark value that we should be setting on the
21 * connection to the server, based on the ACL.
23 nfmark_t
GetNfmarkToServer(HttpRequest
* request
);
29 peer
*_peer
; /* NULL --> origin server */
34 class FwdState
: public RefCountable
37 typedef RefCount
<FwdState
> Pointer
;
39 static void initModule();
41 static void fwdStart(int fd
, StoreEntry
*, HttpRequest
*);
42 void startComplete(FwdServer
*);
44 void fail(ErrorState
*err
);
45 void unregister(int fd
);
47 void handleUnregisteredServerEnd();
49 bool reforwardableStatus(http_status s
);
50 void serverClosed(int fd
);
52 void connectDone(int server_fd
, const DnsLookupDetails
&dns
, comm_err_t status
, int xerrno
);
53 void connectTimeout(int fd
);
55 void negotiateSSL(int fd
);
57 bool checkRetriable();
59 void pconnPush(int fd
, const peer
*_peer
, const HttpRequest
*req
, const char *domain
, Ip::Address
&client_addr
);
61 bool dontRetry() { return flags
.dont_retry
; }
63 void dontRetry(bool val
) { flags
.dont_retry
= val
; }
65 bool ftpPasvFailed() { return flags
.ftp_pasv_failed
; }
67 void ftpPasvFailed(bool val
) { flags
.ftp_pasv_failed
= val
; }
69 static void serversFree(FwdServer
**);
72 // hidden for safer management of self; use static fwdStart
73 FwdState(int fd
, StoreEntry
*, HttpRequest
*);
74 void start(Pointer aSelf
);
76 static void logReplyStatus(int tries
, http_status status
);
77 void updateHierarchyInfo();
78 void doneWithRetries();
81 ErrorState
*makeConnectingError(const err_type type
) const;
82 static void RegisterWithCacheManager(void);
86 void uninit
/**DOCS_NOSEMI*/
87 static void logRotate
/**DOCS_NOSEMI*/
88 void status() /**DOCS_NOSEMI*/
96 static void abort(void*);
107 http_status last_status
;
111 unsigned int dont_retry
:1;
112 unsigned int ftp_pasv_failed
:1;
113 unsigned int forward_completed
:1;
116 Ip::Address src
; /* Client address for this connection. Needed for transparent operations. */
118 // NP: keep this last. It plays with private/public
119 CBDATA_CLASS2(FwdState
);
122 #endif /* SQUID_FORWARD_H */