Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_gzip_filter.c @ 159:981e4af2a425
nginx-0.0.1-2003-10-24-20:10:38 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 24 Oct 2003 16:10:38 +0000 |
parents | d377ee423603 |
children | e7e094d34162 |
comparison
equal
deleted
inserted
replaced
158:d377ee423603 | 159:981e4af2a425 |
---|---|
370 ngx_log_debug(r->connection->log, "DEFLATE(): %08x %08x %d %d %d" _ | 370 ngx_log_debug(r->connection->log, "DEFLATE(): %08x %08x %d %d %d" _ |
371 ctx->zstream.next_in _ ctx->zstream.next_out _ | 371 ctx->zstream.next_in _ ctx->zstream.next_out _ |
372 ctx->zstream.avail_in _ ctx->zstream.avail_out _ rc); | 372 ctx->zstream.avail_in _ ctx->zstream.avail_out _ rc); |
373 | 373 |
374 ctx->in_hunk->pos = (char *) ctx->zstream.next_in; | 374 ctx->in_hunk->pos = (char *) ctx->zstream.next_in; |
375 ctx->out_hunk->last = (char *) ctx->zstream.next_out; | |
375 | 376 |
376 if (ctx->zstream.avail_out == 0) { | 377 if (ctx->zstream.avail_out == 0) { |
377 ctx->out_hunk->last += conf->bufs.size; | |
378 ngx_alloc_link_and_set_hunk(cl, ctx->out_hunk, r->pool, | 378 ngx_alloc_link_and_set_hunk(cl, ctx->out_hunk, r->pool, |
379 ngx_http_gzip_error(ctx)); | 379 ngx_http_gzip_error(ctx)); |
380 *ctx->last_out = cl; | 380 *ctx->last_out = cl; |
381 ctx->last_out = &cl->next; | 381 ctx->last_out = &cl->next; |
382 ctx->redo = 1; | 382 ctx->redo = 1; |
383 | 383 |
384 } else { | 384 } else { |
385 ctx->out_hunk->last = (char *) ctx->zstream.next_out; | |
386 ctx->redo = 0; | 385 ctx->redo = 0; |
387 | 386 |
388 if (ctx->flush == Z_SYNC_FLUSH) { | 387 if (ctx->flush == Z_SYNC_FLUSH) { |
389 ctx->out_hunk->type |= NGX_HUNK_FLUSH; | 388 ctx->out_hunk->type |= NGX_HUNK_FLUSH; |
390 ctx->flush = Z_NO_FLUSH; | 389 ctx->flush = Z_NO_FLUSH; |
501 if (alloc <= ctx->allocated) { | 500 if (alloc <= ctx->allocated) { |
502 p = ctx->free_mem; | 501 p = ctx->free_mem; |
503 ctx->free_mem += alloc; | 502 ctx->free_mem += alloc; |
504 ctx->allocated -= alloc; | 503 ctx->allocated -= alloc; |
505 | 504 |
506 #if 0 | 505 #if 1 |
507 ngx_log_debug(ctx->request->connection->log, "ALLOC: %d:%d:%d:%08X" _ | 506 ngx_log_debug(ctx->request->connection->log, "ALLOC: %d:%d:%d:%08X" _ |
508 items _ size _ alloc _ p); | 507 items _ size _ alloc _ p); |
509 #endif | 508 #endif |
510 | 509 |
511 return p; | 510 return p; |