MCPcopy Create free account
hub / github.com/acl-dev/acl / mime_debug

Method mime_debug

lib_acl_cpp/src/mime/mime.cpp:875–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

873}
874
875void mime::mime_debug(const char* save_path, bool decode /* = true */) {
876 MIME_STATE* state = m_pMimeState;
877 // ��� multipart ��ʽ, �����������������
878 MIME_STATE state_dummy;
879 ACL_ITER iter;
880
881 if (m_pFilePath == NULL) {
882 logger_error("m_pFilePath null");
883 return;
884 }
885
886 if (save_path == NULL) {
887 return;
888 }
889
890 printf("primary node ctype: %s, stype: %s\r\n",
891 get_ctype(), get_stype());
892
893 state_dummy.root = state->root;
894 mime_state_foreach_init(&state_dummy);
895 string header_name, header_filename;
896
897 acl_foreach(iter, &state_dummy) {
898 MIME_NODE *node = (MIME_NODE*) iter.data;
899 printf("child node->ctype: %s, stype: %s\r\n",
900 node->ctype_s ? node->ctype_s : "null",
901 node->stype_s ? node->stype_s : "null");
902
903 if (node->boundary) {
904 printf(">>boundary: %s\r\n",
905 acl_vstring_str(node->boundary));
906 }
907
908 if (node->header_filename) {
909 header_filename.clear();
910 if (!rfc2047::decode(node->header_filename,
911 (int) strlen(node->header_filename),
912 &header_filename,
913 "gbk", true, false)) {
914
915 printf(">>filename: %s\r\n",
916 node->header_filename);
917 } else {
918 printf(">>filename: %s\r\n",
919 header_filename.c_str());
920 }
921 }
922 if (node->charset) {
923 printf(">>charset: %s\r\n", node->charset);
924 }
925 if (node->header_name) {
926 header_name.clear();
927 if (!rfc2047::decode(node->header_name,
928 (int) strlen(node->header_name),
929 &header_name, "gbk", true, false)) {
930
931 printf(">>name: %s\r\n", node->header_name);
932 } else {

Callers 1

mime_test1Function · 0.80

Calls 8

mime_state_foreach_initFunction · 0.85
decodeFunction · 0.85
mime_node_dumpFunction · 0.85
acl_foreachFunction · 0.70
get_ctypeFunction · 0.50
get_stypeFunction · 0.50
clearMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected