ithewei 6 年之前
父节点
当前提交
45e021d31a
共有 2 个文件被更改,包括 1 次插入9 次删除
  1. 1 1
      http/http_content.cpp
  2. 0 8
      http/http_content.h

+ 1 - 1
http/http_content.cpp

@@ -237,7 +237,7 @@ struct multipart_parser_userdata {
     }
 
     void handle_data() {
-        if (name.c_str() != 0) {
+        if (name.size() != 0) {
             (*mp)[name] = FormData(part_data.c_str(), filename.c_str());
         }
         name.clear();

+ 0 - 8
http/http_content.h

@@ -84,14 +84,6 @@ struct FormData {
             this->filename = filename;
         }
     }
-    FormData(const char* c_str, bool file = false) {
-        if (c_str) {
-            file ? filename = c_str : content = c_str;
-        }
-    }
-    FormData(const std::string& str, bool file = false) {
-        file ? filename = str : content = str;
-    }
     FormData(int n) {
         content = std::to_string(n);
     }