Lines 16-22
Link Here
|
16 |
See http://devel.squid-cache.org/icap/ for further information |
16 |
See http://devel.squid-cache.org/icap/ for further information |
17 |
about the ICAP client project. |
17 |
about the ICAP client project. |
18 |
|
18 |
|
19 |
Patch last updated: 2007-03-04 |
19 |
Patch last updated: 2007-03-18 |
20 |
|
20 |
|
21 |
Note: the patchset needs manual adjustments once in a while because |
21 |
Note: the patchset needs manual adjustments once in a while because |
22 |
the ICAP developers develop against Squid-2-HEAD and not |
22 |
the ICAP developers develop against Squid-2-HEAD and not |
Lines 2238-2249
Link Here
|
2238 |
if (define[$2] != "") |
2238 |
if (define[$2] != "") |
2239 |
Index: src/client_side.c |
2239 |
Index: src/client_side.c |
2240 |
=================================================================== |
2240 |
=================================================================== |
2241 |
RCS file: /cvsroot/squid/squid/src/client_side.c,v |
2241 |
--- src/client_side.c.orig Wed Mar 14 15:11:26 2007 |
2242 |
retrieving revision 1.154 |
2242 |
+++ src/client_side.c Sun Mar 18 11:16:30 2007 |
2243 |
retrieving revision 1.89.4.14 |
|
|
2244 |
diff -p -u -b -r1.154 -r1.89.4.14 |
2245 |
--- src/client_side.c 11 Dec 2006 00:53:11 -0000 1.154 |
2246 |
+++ src/client_side.c 12 Dec 2006 22:49:44 -0000 1.89.4.14 |
2247 |
@@ -109,7 +109,7 @@ static const char *const crlf = "\r\n"; |
2243 |
@@ -109,7 +109,7 @@ static const char *const crlf = "\r\n"; |
2248 |
static CWCB clientWriteComplete; |
2244 |
static CWCB clientWriteComplete; |
2249 |
static CWCB clientWriteBodyComplete; |
2245 |
static CWCB clientWriteBodyComplete; |
Lines 2300-2306
Link Here
|
2300 |
clientCreateStoreEntry(clientHttpRequest * h, method_t m, request_flags flags) |
2296 |
clientCreateStoreEntry(clientHttpRequest * h, method_t m, request_flags flags) |
2301 |
{ |
2297 |
{ |
2302 |
StoreEntry *e; |
2298 |
StoreEntry *e; |
2303 |
@@ -638,6 +641,10 @@ clientRedirectDone(void *data, char *res |
2299 |
@@ -640,6 +643,10 @@ clientRedirectDone(void *data, char *res |
2304 |
if (urlgroup && *urlgroup) |
2300 |
if (urlgroup && *urlgroup) |
2305 |
http->request->urlgroup = xstrdup(urlgroup); |
2301 |
http->request->urlgroup = xstrdup(urlgroup); |
2306 |
clientInterpretRequestHeaders(http); |
2302 |
clientInterpretRequestHeaders(http); |
Lines 2311-2317
Link Here
|
2311 |
#if HEADERS_LOG |
2307 |
#if HEADERS_LOG |
2312 |
headersLog(0, 1, request->method, request); |
2308 |
headersLog(0, 1, request->method, request); |
2313 |
#endif |
2309 |
#endif |
2314 |
@@ -1352,11 +1359,22 @@ httpRequestFree(void *data) |
2310 |
@@ -1368,11 +1375,22 @@ httpRequestFree(void *data) |
2315 |
/* Unlink us from the clients request list */ |
2311 |
/* Unlink us from the clients request list */ |
2316 |
dlinkDelete(&http->node, &http->conn->reqs); |
2312 |
dlinkDelete(&http->node, &http->conn->reqs); |
2317 |
dlinkDelete(&http->active, &ClientActiveRequests); |
2313 |
dlinkDelete(&http->active, &ClientActiveRequests); |
Lines 2335-2341
Link Here
|
2335 |
connStateFree(int fd, void *data) |
2331 |
connStateFree(int fd, void *data) |
2336 |
{ |
2332 |
{ |
2337 |
ConnStateData *connState = data; |
2333 |
ConnStateData *connState = data; |
2338 |
@@ -1376,8 +1394,9 @@ connStateFree(int fd, void *data) |
2334 |
@@ -1392,8 +1410,9 @@ connStateFree(int fd, void *data) |
2339 |
authenticateAuthUserRequestUnlock(connState->auth_user_request); |
2335 |
authenticateAuthUserRequestUnlock(connState->auth_user_request); |
2340 |
connState->auth_user_request = NULL; |
2336 |
connState->auth_user_request = NULL; |
2341 |
authenticateOnCloseConnection(connState); |
2337 |
authenticateOnCloseConnection(connState); |
Lines 2346-2352
Link Here
|
2346 |
if (connState->pinning.fd >= 0) |
2342 |
if (connState->pinning.fd >= 0) |
2347 |
comm_close(connState->pinning.fd); |
2343 |
comm_close(connState->pinning.fd); |
2348 |
cbdataFree(connState); |
2344 |
cbdataFree(connState); |
2349 |
@@ -1575,7 +1594,7 @@ clientSetKeepaliveFlag(clientHttpRequest |
2345 |
@@ -1591,7 +1610,7 @@ clientSetKeepaliveFlag(clientHttpRequest |
2350 |
} |
2346 |
} |
2351 |
} |
2347 |
} |
2352 |
|
2348 |
|
Lines 2355-2361
Link Here
|
2355 |
clientCheckContentLength(request_t * r) |
2351 |
clientCheckContentLength(request_t * r) |
2356 |
{ |
2352 |
{ |
2357 |
switch (r->method) { |
2353 |
switch (r->method) { |
2358 |
@@ -1594,7 +1613,7 @@ clientCheckContentLength(request_t * r) |
2354 |
@@ -1610,7 +1629,7 @@ clientCheckContentLength(request_t * r) |
2359 |
/* NOT REACHED */ |
2355 |
/* NOT REACHED */ |
2360 |
} |
2356 |
} |
2361 |
|
2357 |
|
Lines 2364-2370
Link Here
|
2364 |
clientCachable(clientHttpRequest * http) |
2360 |
clientCachable(clientHttpRequest * http) |
2365 |
{ |
2361 |
{ |
2366 |
request_t *req = http->request; |
2362 |
request_t *req = http->request; |
2367 |
@@ -1620,7 +1639,7 @@ clientCachable(clientHttpRequest * http) |
2363 |
@@ -1636,7 +1655,7 @@ clientCachable(clientHttpRequest * http) |
2368 |
} |
2364 |
} |
2369 |
|
2365 |
|
2370 |
/* Return true if we can query our neighbors for this object */ |
2366 |
/* Return true if we can query our neighbors for this object */ |
Lines 2373-2379
Link Here
|
2373 |
clientHierarchical(clientHttpRequest * http) |
2369 |
clientHierarchical(clientHttpRequest * http) |
2374 |
{ |
2370 |
{ |
2375 |
const char *url = http->uri; |
2371 |
const char *url = http->uri; |
2376 |
@@ -3307,7 +3326,7 @@ clientProcessRequest2(clientHttpRequest |
2372 |
@@ -3302,7 +3321,7 @@ clientProcessRequest2(clientHttpRequest |
2377 |
return LOG_TCP_HIT; |
2373 |
return LOG_TCP_HIT; |
2378 |
} |
2374 |
} |
2379 |
|
2375 |
|
Lines 2382-2388
Link Here
|
2382 |
clientProcessRequest(clientHttpRequest * http) |
2378 |
clientProcessRequest(clientHttpRequest * http) |
2383 |
{ |
2379 |
{ |
2384 |
char *url = http->uri; |
2380 |
char *url = http->uri; |
2385 |
@@ -3318,6 +3337,11 @@ clientProcessRequest(clientHttpRequest * |
2381 |
@@ -3313,6 +3332,11 @@ clientProcessRequest(clientHttpRequest * |
2386 |
RequestMethodStr[r->method], |
2382 |
RequestMethodStr[r->method], |
2387 |
url); |
2383 |
url); |
2388 |
r->flags.collapsed = 0; |
2384 |
r->flags.collapsed = 0; |
Lines 2394-2400
Link Here
|
2394 |
if (r->method == METHOD_CONNECT && !http->redirect.status) { |
2390 |
if (r->method == METHOD_CONNECT && !http->redirect.status) { |
2395 |
http->log_type = LOG_TCP_MISS; |
2391 |
http->log_type = LOG_TCP_MISS; |
2396 |
#if USE_SSL && SSL_CONNECT_INTERCEPT |
2392 |
#if USE_SSL && SSL_CONNECT_INTERCEPT |
2397 |
@@ -3812,6 +3836,20 @@ clientReadRequest(int fd, void *data) |
2393 |
@@ -3808,6 +3832,20 @@ clientReadRequest(int fd, void *data) |
2398 |
(long) conn->in.offset, (long) conn->in.size); |
2394 |
(long) conn->in.offset, (long) conn->in.size); |
2399 |
len = conn->in.size - conn->in.offset - 1; |
2395 |
len = conn->in.size - conn->in.offset - 1; |
2400 |
} |
2396 |
} |
Lines 2415-2431
Link Here
|
2415 |
statCounter.syscalls.sock.reads++; |
2411 |
statCounter.syscalls.sock.reads++; |
2416 |
size = FD_READ_METHOD(fd, conn->in.buf + conn->in.offset, len); |
2412 |
size = FD_READ_METHOD(fd, conn->in.buf + conn->in.offset, len); |
2417 |
if (size > 0) { |
2413 |
if (size > 0) { |
2418 |
@@ -3916,7 +3954,8 @@ clientReadRequest(int fd, void *data) |
2414 |
@@ -3913,6 +3951,8 @@ clientReadRequest(int fd, void *data) |
2419 |
/* add to the client request queue */ |
|
|
2420 |
dlinkAddTail(http, &http->node, &conn->reqs); |
2415 |
dlinkAddTail(http, &http->node, &conn->reqs); |
2421 |
conn->nrequests++; |
2416 |
conn->nrequests++; |
2422 |
- commSetTimeout(fd, Config.Timeout.lifetime, clientLifetimeTimeout, http); |
2417 |
commSetTimeout(fd, Config.Timeout.lifetime, clientLifetimeTimeout, http); |
2423 |
+ F->pconn.uses++; |
2418 |
+ F->pconn.uses++; |
2424 |
+ F->pconn.type = 0; |
2419 |
+ F->pconn.type = 0; |
2425 |
if (parser_return_code < 0) { |
2420 |
if (parser_return_code < 0) { |
2426 |
debug(33, 1) ("clientReadRequest: FD %d (%s:%d) Invalid Request\n", fd, fd_table[fd].ipaddr, fd_table[fd].remote_port); |
2421 |
debug(33, 1) ("clientReadRequest: FD %d (%s:%d) Invalid Request\n", fd, fd_table[fd].ipaddr, fd_table[fd].remote_port); |
2427 |
err = errorCon(ERR_INVALID_REQ, HTTP_BAD_REQUEST, NULL); |
2422 |
err = errorCon(ERR_INVALID_REQ, HTTP_BAD_REQUEST, NULL); |
2428 |
@@ -4086,7 +4125,7 @@ clientReadRequest(int fd, void *data) |
2423 |
@@ -4082,7 +4122,7 @@ clientReadRequest(int fd, void *data) |
2429 |
} |
2424 |
} |
2430 |
|
2425 |
|
2431 |
/* file_read like function, for reading body content */ |
2426 |
/* file_read like function, for reading body content */ |
Lines 2434-2440
Link Here
|
2434 |
clientReadBody(request_t * request, char *buf, size_t size, CBCB * callback, void *cbdata) |
2429 |
clientReadBody(request_t * request, char *buf, size_t size, CBCB * callback, void *cbdata) |
2435 |
{ |
2430 |
{ |
2436 |
ConnStateData *conn = request->body_reader_data; |
2431 |
ConnStateData *conn = request->body_reader_data; |
2437 |
@@ -4215,7 +4254,7 @@ clientProcessBody(ConnStateData * conn) |
2432 |
@@ -4211,7 +4251,7 @@ clientProcessBody(ConnStateData * conn) |
2438 |
} |
2433 |
} |
2439 |
|
2434 |
|
2440 |
/* Abort a body request */ |
2435 |
/* Abort a body request */ |
Lines 2443-2449
Link Here
|
2443 |
clientAbortBody(request_t * request) |
2438 |
clientAbortBody(request_t * request) |
2444 |
{ |
2439 |
{ |
2445 |
ConnStateData *conn = request->body_reader_data; |
2440 |
ConnStateData *conn = request->body_reader_data; |
2446 |
@@ -4257,7 +4296,7 @@ requestTimeout(int fd, void *data) |
2441 |
@@ -4253,7 +4293,7 @@ requestTimeout(int fd, void *data) |
2447 |
* Some data has been sent to the client, just close the FD |
2442 |
* Some data has been sent to the client, just close the FD |
2448 |
*/ |
2443 |
*/ |
2449 |
comm_close(fd); |
2444 |
comm_close(fd); |
Lines 2452-2461
Link Here
|
2452 |
/* |
2447 |
/* |
2453 |
* assume its a persistent connection; just close it |
2448 |
* assume its a persistent connection; just close it |
2454 |
*/ |
2449 |
*/ |
2455 |
@@ -4978,6 +5017,52 @@ varyEvaluateMatch(StoreEntry * entry, re |
2450 |
@@ -4974,6 +5014,52 @@ varyEvaluateMatch(StoreEntry * entry, re |
|
|
2451 |
} |
2456 |
} |
2452 |
} |
2457 |
} |
2453 |
} |
2458 |
|
2454 |
+ |
2459 |
+#if HS_FEAT_ICAP |
2455 |
+#if HS_FEAT_ICAP |
2460 |
+static int |
2456 |
+static int |
2461 |
+clientIcapReqMod(clientHttpRequest * http) |
2457 |
+clientIcapReqMod(clientHttpRequest * http) |
Lines 2501-2510
Link Here
|
2501 |
+ return 1; |
2497 |
+ return 1; |
2502 |
+} |
2498 |
+} |
2503 |
+#endif |
2499 |
+#endif |
2504 |
+ |
2500 |
|
2505 |
/* This is a handler normally called by comm_close() */ |
2501 |
/* This is a handler normally called by comm_close() */ |
2506 |
static void |
2502 |
static void |
2507 |
clientPinnedConnectionClosed(int fd, void *data) |
|
|
2508 |
Index: src/comm.c |
2503 |
Index: src/comm.c |
2509 |
=================================================================== |
2504 |
=================================================================== |
2510 |
RCS file: /cvsroot/squid/squid/src/comm.c,v |
2505 |
RCS file: /cvsroot/squid/squid/src/comm.c,v |