GNUnet 0.24.1-15-gab6ed22f1
gnunet_mhd_lib.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2014, 2015, 2016, 2020, 2024 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
25#ifndef GNUNET_MHD_LIB_H
26#define GNUNET_MHD_LIB_H
27
28#include "gnunet_util_lib.h"
29#include <microhttpd.h>
30#include <jansson.h>
31
32
37{
42
47
52
57
62};
63
64
81GNUNET_MHD_post_parser (size_t buffer_max,
82 struct MHD_Connection *connection,
83 void **con_cls,
84 const char *upload_data,
85 size_t *upload_data_size,
86 json_t **json);
87
88
96void
97GNUNET_MHD_post_parser_cleanup (void *con_cls);
98
99
100#endif
101/* end of gnunet_mhd_lib.h */
GNUNET_MHD_PostResult
Return codes from GNUNET_MHD_post_parser().
@ GNUNET_MHD_PR_CONTINUE
Parsing continues, call again soon!
@ GNUNET_MHD_PR_SUCCESS
Parsing successful, JSON result is in *json.
@ GNUNET_MHD_PR_OUT_OF_MEMORY
Sorry, memory allocation (malloc()) failed.
@ GNUNET_MHD_PR_REQUEST_TOO_LARGE
Request size exceeded buffer_max argument.
@ GNUNET_MHD_PR_JSON_INVALID
JSON parsing failed.
enum GNUNET_MHD_PostResult GNUNET_MHD_post_parser(size_t buffer_max, struct MHD_Connection *connection, void **con_cls, const char *upload_data, size_t *upload_data_size, json_t **json)
Process a POST request containing a JSON object.
Definition: mhd_upload.c:266
void GNUNET_MHD_post_parser_cleanup(void *con_cls)
Function called whenever we are done with a request to clean up our state.
Definition: mhd_upload.c:368