comparison src/core/ngx_string.c @ 527:7fa11e5c6e96 release-0.1.38

nginx-0.1.38-RELEASE import *) Feature: the "limit_rate" directive is supported in in proxy and FastCGI mode. *) Feature: the "X-Accel-Limit-Rate" response header line is supported in proxy and FastCGI mode. *) Feature: the "break" directive. *) Feature: the "log_not_found" directive. *) Bugfix: the response status code was not changed when request was redirected by the ""X-Accel-Redirect" header line. *) Bugfix: the variables set by the "set" directive could not be used in SSI. *) Bugfix: the segmentation fault may occurred if the SSI page has more than one remote subrequest. *) Bugfix: nginx treated the backend response as invalid if the status line in the header was transferred in two packets; the bug had appeared in 0.1.29. *) Feature: the "ssi_types" directive. *) Feature: the "autoindex_exact_size" directive. *) Bugfix: the ngx_http_autoindex_module did not support the long file names in UTF-8. *) Feature: the IMAP/POP3 proxy.
author Igor Sysoev <igor@sysoev.ru>
date Fri, 08 Jul 2005 14:34:20 +0000
parents 09b42134ac0c
children ecd9c160f25b
comparison
equal deleted inserted replaced
526:e31ce4d8b8e6 527:7fa11e5c6e96
751 751
752 if (c < 0x80) { 752 if (c < 0x80) {
753 continue; 753 continue;
754 } 754 }
755 755
756 if (c < 0xC0) { 756 if (c >= 0xc0) {
757 /* invalid utf */ 757 for (c <<= 1; c & 0x80; c <<= 1) {
758 return utf->len; 758 i++;
759 } 759 }
760 760
761 for (c <<= 1; c & 0x80; c <<= 1) { 761 continue;
762 i++; 762 }
763 } 763
764 /* invalid utf */
765
766 return utf->len;
764 } 767 }
765 768
766 return len; 769 return len;
770 }
771
772
773 u_char *
774 ngx_utf_cpystrn(u_char *dst, u_char *src, size_t n)
775 {
776 u_char c;
777
778 if (n == 0) {
779 return dst;
780 }
781
782 for ( /* void */ ; --n; dst++, src++) {
783
784 c = *src;
785 *dst = c;
786
787 if (c < 0x80) {
788 if (*dst != '\0') {
789 continue;
790 }
791
792 return dst;
793 }
794
795 if (c >= 0xc0) {
796 for (c <<= 1; c & 0x80; c <<= 1) {
797 *++dst = *++src;
798 }
799
800 continue;
801 }
802
803 /* invalid utf */
804 }
805
806 *dst = '\0';
807
808 return dst;
767 } 809 }
768 810
769 811
770 uintptr_t 812 uintptr_t
771 ngx_escape_uri(u_char *dst, u_char *src, size_t size, ngx_uint_t type) 813 ngx_escape_uri(u_char *dst, u_char *src, size_t size, ngx_uint_t type)