瀏覽代碼

Alternative to mg_upload (Step 53/?)

bel 9 年之前
父節點
當前提交
d224b8291d
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/civetweb.c

+ 5 - 2
src/civetweb.c

@@ -8967,9 +8967,12 @@ mg_upload(struct mg_connection *conn, const char *destination_dir)
 	struct mg_form_data_handler fdh = {mg_upload_field_found,
 	                                   NULL,
 	                                   mg_upload_field_stored,
-	                                   &fud};
+	                                   0};
+	int ret;
+
+	fdh.user_data = (void *)&fud;
+	ret = mg_handle_form_request(conn, &fdh);
 
-	int ret = mg_handle_form_request(conn, &fdh);
 	if (ret < 0) {
 		mg_cry(conn, "%s: Error while parsing the request", __func__);
 	}