Bläddra i källkod

Alternative to mg_upload (Step 1/?)

bel 9 år sedan
förälder
incheckning
9713e3688c
2 ändrade filer med 36 tillägg och 0 borttagningar
  1. 6 0
      src/civetweb.c
  2. 30 0
      src/handle_form.inl

+ 6 - 0
src/civetweb.c

@@ -20,6 +20,7 @@
  * THE SOFTWARE.
  */
 
+
 #if defined(_WIN32)
 #if !defined(_CRT_SECURE_NO_WARNINGS)
 #define _CRT_SECURE_NO_WARNINGS /* Disable deprecation warning in VS2005 */
@@ -8789,6 +8790,11 @@ get_remote_ip(const struct mg_connection *conn)
 	return ntohl(*(uint32_t *)&conn->client.rsa.sin.sin_addr);
 }
 
+
+/* Experimental replacement for mg_upload. */
+#include "handle_form.inl"
+
+
 int
 mg_upload(struct mg_connection *conn, const char *destination_dir)
 {

+ 30 - 0
src/handle_form.inl

@@ -0,0 +1,30 @@
+/* Copyright (c) 2016 the Civetweb developers
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/********************/
+/* EXPERIMENTAL !!! */
+/********************/
+
+int handle_form_data(struct mg_connection *conn, struct mg_form_data_handler *fdh)
+{
+
+    return 0;
+}