comparison ngx_http_upstream_keepalive_module.c @ 30:c5b498c5aa3c

Keepalive: update comments, style.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 31 Aug 2011 05:43:53 +0400
parents c7c4b2d68fdf
children 78fd926c306d
comparison
equal deleted inserted replaced
29:c7c4b2d68fdf 30:c5b498c5aa3c
316 * For memcached this means status either 404 or 200. For status 200 we 316 * For memcached this means status either 404 or 200. For status 200 we
317 * should also check if all response body was read (u->length == 0) and 317 * should also check if all response body was read (u->length == 0) and
318 * make sure that u->length is valid (we use u->header_sent flag to test 318 * make sure that u->length is valid (we use u->header_sent flag to test
319 * this). Memcached is the only supported protocol for now. 319 * this). Memcached is the only supported protocol for now.
320 * 320 *
321 * Some notes on other possibilities (incomplete): 321 * With experimental patches we are able to cache other connections as
322 * 322 * well. Connection status is signalled via u->keepalive flag.
323 * fastcgi: u->pipe->upstream_done should be sufficient
324 *
325 * proxy buffered: u->pipe->upstream_done, 304 replies, replies to head
326 * requests (see RFC 2616, 4.4 Message Length)
327 *
328 * proxy unbuffered: 200 as for memcached (with u->length == 0 and
329 * header_sent), 304, replies to head requests
330 *
331 * subrequest_in_memory: won't work as of now
332 *
333 * TODO: move this logic to protocol modules (NGX_PEER_KEEPALIVE?)
334 */ 323 */
335 324
336 u = kp->upstream; 325 u = kp->upstream;
337 c = pc->connection; 326 c = pc->connection;
338 status = u->headers_in.status_n; 327 status = u->headers_in.status_n;
532 kcf->max_cached = n; 521 kcf->max_cached = n;
533 522
534 for (i = 2; i < cf->args->nelts; i++) { 523 for (i = 2; i < cf->args->nelts; i++) {
535 524
536 if (ngx_strcmp(value[i].data, "single") == 0) { 525 if (ngx_strcmp(value[i].data, "single") == 0) {
537
538 kcf->single = 1; 526 kcf->single = 1;
539
540 continue; 527 continue;
541 } 528 }
542 529
543 goto invalid; 530 goto invalid;
544 } 531 }