| 74 | } |
| 75 | |
| 76 | http_pipe* http_response::get_pipe(const char* to_charset) |
| 77 | { |
| 78 | if (to_charset == NULL || *to_charset == 0) { |
| 79 | return NULL; |
| 80 | } |
| 81 | |
| 82 | // ��Ҫ�����Ӧͷ�ַ�����Ϣ |
| 83 | const char* ptr = client_->header_value("Content-Type"); |
| 84 | if (ptr == NULL || *ptr == 0) { |
| 85 | return NULL; |
| 86 | } |
| 87 | |
| 88 | #if !defined(ACL_MIME_DISABLE) |
| 89 | |
| 90 | http_ctype ctype; |
| 91 | ctype.parse(ptr); |
| 92 | |
| 93 | const char* from_charset = ctype.get_charset(); |
| 94 | |
| 95 | if (from_charset && strcasecmp(from_charset, to_charset) != 0) { |
| 96 | http_pipe* hp = NEW http_pipe(); |
| 97 | hp->set_charset(from_charset, to_charset); |
| 98 | return hp; |
| 99 | } else { |
| 100 | return NULL; |
| 101 | } |
| 102 | #else |
| 103 | return NULL; |
| 104 | #endif // !defined(ACL_MIME_DISABLE) |
| 105 | } |
| 106 | |
| 107 | bool http_response::get_body(xml& out, const char* to_charset /* = NULL */) |
| 108 | { |
nothing calls this directly
no test coverage detected