1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-07-29 21:01:13 +03:00

Alternative to mg_upload (Step 12/?)

This commit is contained in:
bel
2016-01-13 23:15:20 +01:00
parent f39e377ffc
commit fee3db104b
2 changed files with 13 additions and 2 deletions

View File

@ -177,6 +177,13 @@ field_found(const char *key,
size_t vallen,
void *user_data)
{
struct mg_connection *conn = (struct mg_connection *)user_data;
mg_write(conn, key, keylen);
mg_printf(conn, " = ");
mg_write(conn, value, vallen);
mg_printf(conn, "\r\n");
return 0;
}
@ -192,6 +199,9 @@ FormHandler(struct mg_connection *conn, void *cbdata)
/* TODO: Checks before calling handle_form_data ? */
(void)req_info;
mg_printf(conn, "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\n\r\n");
fdh.user_data = (void *)conn;
/* TODO: Handle the return value */
ret = mg_handle_form_data(conn, &fdh);