1
0
mirror of https://github.com/lammertb/libhttp.git synced 2026-01-03 16:02:30 +03:00

Alternative to mg_upload (Step 6/?)

This commit is contained in:
bel
2016-01-10 23:59:13 +01:00
parent ff73f34ca6
commit 6725df7b1c
3 changed files with 67 additions and 27 deletions

View File

@@ -155,18 +155,23 @@ FileHandler(struct mg_connection *conn, void *cbdata)
}
struct mg_form_data_handler {
int (*field_found)(const char *key, const char *value);
};
int
FormHandler(struct mg_connection *conn, void *cbdata)
{
/* Handler may access the request info using mg_get_request_info */
const struct mg_request_info *req_info = mg_get_request_info(conn);
int ret;
struct mg_form_data_handler *fdh = 0;
struct mg_form_data_handler fdh = {0};
/* TODO: Checks before calling handle_form_data ? */
(void)req_info;
ret = handle_form_data(conn, fdh);
ret = handle_form_data(conn, &fdh);
return 1;
}