| 724 | } |
| 725 | |
| 726 | void http_request::set_charset_conv() |
| 727 | { |
| 728 | if (client_ == NULL || local_charset_[0] == 0) { |
| 729 | return; |
| 730 | } |
| 731 | |
| 732 | // ��Ҫ�����Ӧͷ�ַ�����Ϣ |
| 733 | const char* ptr = client_->header_value("Content-Type"); |
| 734 | if (ptr == NULL || *ptr == 0) { |
| 735 | return; |
| 736 | } |
| 737 | |
| 738 | #if !defined(ACL_MIME_DISABLE) |
| 739 | |
| 740 | http_ctype ctype; |
| 741 | ctype.parse(ptr); |
| 742 | |
| 743 | const char* from_charset = ctype.get_charset(); |
| 744 | |
| 745 | if (from_charset == NULL || *from_charset == 0 |
| 746 | || strcasecmp(from_charset, local_charset_) == 0) { |
| 747 | |
| 748 | return; |
| 749 | } |
| 750 | |
| 751 | // ��ʼ���ַ���ת���� |
| 752 | |
| 753 | if (conv_ == NULL) { |
| 754 | conv_ = charset_conv::create(from_charset, local_charset_); |
| 755 | } |
| 756 | // ����֮ǰ�������ַ���ת���� |
| 757 | else if (!conv_->update_begin(from_charset, local_charset_)) { |
| 758 | logger_error("invalid charset conv, from %s, to %s", |
| 759 | from_charset, local_charset_); |
| 760 | delete conv_; |
| 761 | conv_ = NULL; |
| 762 | } |
| 763 | |
| 764 | #endif // !defined(ACL_MIME_DISABLE) |
| 765 | } |
| 766 | |
| 767 | http_pipe* http_request::get_pipe(const char* to_charset) |
| 768 | { |
nothing calls this directly
no test coverage detected