comparison src/http/modules/ngx_http_charset_filter_module.c @ 370:9a242235a80a NGINX_0_6_29

nginx 0.6.29 *) Feature: the ngx_google_perftools_module. *) Bugfix: the ngx_http_perl_module could be not built on 64-bit platforms; bug appeared in 0.6.27.
author Igor Sysoev <http://sysoev.ru>
date Tue, 18 Mar 2008 00:00:00 +0300
parents 4276c2f1f434
children 3ce4580ae286
comparison
equal deleted inserted replaced
369:5906b8639a07 370:9a242235a80a
559 559
560 560
561 static ngx_uint_t 561 static ngx_uint_t
562 ngx_http_charset_recode(ngx_buf_t *b, u_char *table) 562 ngx_http_charset_recode(ngx_buf_t *b, u_char *table)
563 { 563 {
564 u_char *p; 564 u_char *p, *last;
565 565
566 for (p = b->pos; p < b->last; p++) { 566 last = b->last;
567 567
568 if (*p == table[*p]) { 568 for (p = b->pos; p < last; p++) {
569 continue; 569
570 } 570 if (*p != table[*p]) {
571 571 goto recode;
572 while (p < b->last) { 572 }
573 }
574
575 return 0;
576
577 recode:
578
579 do {
580 if (*p != table[*p]) {
573 *p = table[*p]; 581 *p = table[*p];
574 p++; 582 }
575 } 583
576 584 p++;
577 b->in_file = 0; 585
578 586 } while (p < last);
579 return 1; 587
580 } 588 b->in_file = 0;
581 589
582 return 0; 590 return 1;
583 } 591 }
584 592
585 593
586 static ngx_chain_t * 594 static ngx_chain_t *
587 ngx_http_charset_recode_from_utf8(ngx_pool_t *pool, ngx_buf_t *buf, 595 ngx_http_charset_recode_from_utf8(ngx_pool_t *pool, ngx_buf_t *buf,