]>
Commit | Line | Data |
---|---|---|
684396e0 AM |
1 | Index: squid/src/client_side.c |
2 | diff -c squid/src/client_side.c:1.561.2.48 squid/src/client_side.c:1.561.2.49 | |
3 | *** squid/src/client_side.c:1.561.2.48 Sun Dec 14 06:33:46 2003 | |
4 | --- squid/src/client_side.c Sun Dec 14 06:40:46 2003 | |
5 | *************** | |
6 | *** 100,105 **** | |
7 | --- 100,106 ---- | |
8 | static void clientBuildReplyHeader(clientHttpRequest * http, HttpReply * rep); | |
9 | static clientHttpRequest *parseHttpRequestAbort(ConnStateData * conn, const char *uri); | |
10 | static clientHttpRequest *parseHttpRequest(ConnStateData *, method_t *, int *, char **, size_t *); | |
11 | + static void clientRedirectStart(clientHttpRequest * http); | |
12 | static RH clientRedirectDone; | |
13 | static void clientCheckNoCache(clientHttpRequest *); | |
14 | static void clientCheckNoCacheDone(int answer, void *data); | |
15 | *************** | |
16 | *** 244,250 **** | |
17 | http->uri = xstrdup(urlCanonical(http->request)); | |
18 | assert(http->redirect_state == REDIRECT_NONE); | |
19 | http->redirect_state = REDIRECT_PENDING; | |
20 | ! redirectStart(http, clientRedirectDone, http); | |
21 | } else { | |
22 | int require_auth = (answer == ACCESS_REQ_PROXY_AUTH || aclIsProxyAuth(AclMatchedName)); | |
23 | debug(33, 5) ("Access Denied: %s\n", http->uri); | |
24 | --- 245,251 ---- | |
25 | http->uri = xstrdup(urlCanonical(http->request)); | |
26 | assert(http->redirect_state == REDIRECT_NONE); | |
27 | http->redirect_state = REDIRECT_PENDING; | |
28 | ! clientRedirectStart(http); | |
29 | } else { | |
30 | int require_auth = (answer == ACCESS_REQ_PROXY_AUTH || aclIsProxyAuth(AclMatchedName)); | |
31 | debug(33, 5) ("Access Denied: %s\n", http->uri); | |
32 | *************** | |
33 | *** 289,294 **** | |
34 | --- 290,322 ---- | |
35 | authenticateAuthUserRequestLock(err->auth_user_request); | |
36 | err->callback_data = NULL; | |
37 | errorAppendEntry(http->entry, err); | |
38 | + } | |
39 | + } | |
40 | + | |
41 | + static void | |
42 | + clientRedirectAccessCheckDone(int answer, void *data) | |
43 | + { | |
44 | + clientHttpRequest *http = data; | |
45 | + http->acl_checklist = NULL; | |
46 | + if (answer == ACCESS_ALLOWED) | |
47 | + redirectStart(http, clientRedirectDone, http); | |
48 | + else | |
49 | + clientRedirectDone(http, NULL); | |
50 | + } | |
51 | + | |
52 | + static void | |
53 | + clientRedirectStart(clientHttpRequest * http) | |
54 | + { | |
55 | + debug(33, 5) ("clientRedirectStart: '%s'\n", http->uri); | |
56 | + if (Config.Program.redirect == NULL) { | |
57 | + clientRedirectDone(http, NULL); | |
58 | + return; | |
59 | + } | |
60 | + if (Config.accessList.redirector) { | |
61 | + http->acl_checklist = clientAclChecklistCreate(Config.accessList.redirector, http); | |
62 | + aclNBCheck(http->acl_checklist, clientRedirectAccessCheckDone, http); | |
63 | + } else { | |
64 | + redirectStart(http, clientRedirectDone, http); | |
65 | } | |
66 | } | |
67 | ||
68 | Index: squid/src/redirect.c | |
69 | diff -c squid/src/redirect.c:1.88.2.2 squid/src/redirect.c:1.88.2.3 | |
70 | *** squid/src/redirect.c:1.88.2.2 Tue Sep 23 19:03:36 2003 | |
71 | --- squid/src/redirect.c Sun Dec 14 06:40:47 2003 | |
72 | *************** | |
73 | *** 100,122 **** | |
74 | assert(http); | |
75 | assert(handler); | |
76 | debug(61, 5) ("redirectStart: '%s'\n", http->uri); | |
77 | - if (Config.Program.redirect == NULL) { | |
78 | - handler(data, NULL); | |
79 | - return; | |
80 | - } | |
81 | - if (Config.accessList.redirector) { | |
82 | - aclCheck_t ch; | |
83 | - memset(&ch, '\0', sizeof(ch)); | |
84 | - ch.src_addr = http->conn->peer.sin_addr; | |
85 | - ch.my_addr = http->conn->me.sin_addr; | |
86 | - ch.my_port = ntohs(http->conn->me.sin_port); | |
87 | - ch.request = http->request; | |
88 | - if (!aclCheckFast(Config.accessList.redirector, &ch)) { | |
89 | - /* denied -- bypass redirector */ | |
90 | - handler(data, NULL); | |
91 | - return; | |
92 | - } | |
93 | - } | |
94 | if (Config.onoff.redirector_bypass && redirectors->stats.queue_size) { | |
95 | /* Skip redirector if there is one request queued */ | |
96 | n_bypassed++; | |
97 | --- 100,105 ---- |