56 MHD_PANIC (
_ (
"libmicrohttpd API violation.\n"));
138 const char *value_start,
151 if (0 !=
pp->xbuf_pos)
186 value_start +=
delta;
209 else if ( (
xoff > 1) &&
238 if (
pp->must_ikvi || (0 !=
xoff) )
240 pp->must_ikvi =
false;
243 (
const char *) &
pp[1],
283 char *
kbuf = (
char *) &
pp[1];
332 pp->must_ikvi =
true;
398 pp->value_offset = 0;
460 if ( (
pp->buffer_pos +
key_len >=
pp->buffer_size) ||
474 pp->must_unescape_key =
true;
481 if (
pp->must_unescape_key)
483 kbuf[
pp->buffer_pos] =
'\0';
486 pp->must_unescape_key =
false;
494 pp->value_offset = 0;
544 pp->must_unescape_key =
true;
552 if (
pp->must_unescape_key)
554 kbuf[
pp->buffer_pos] =
'\0';
557 pp->must_unescape_key =
false;
568 pp->must_ikvi =
false;
633 char *
buf = (
char *) &
pp[1];
636 if (
pp->buffer_pos < 2 +
blen)
638 if (
pp->buffer_pos ==
pp->buffer_size)
662 (*ioffptr) +=
pp->buffer_pos;
671 (*ioffptr) += 2 +
blen;
705 (
spos[-1] !=
' ') ) )
720 (*destination)[
vlen - 1] =
'\0';
749 char *
buf = (
char *) &
pp[1];
784 &
pp->content_filename);
795 &
pp->content_transfer_encoding);
826 char *
buf = (
char *) &
pp[1];
846 if (0 ==
memcmp (
"\r\n--",
870 (*ioffptr) +=
blen + 4;
881 (
pp->buffer_pos ==
pp->buffer_size) )
892 if ( ( (
pp->must_ikvi) ||
897 pp->content_filename,
899 pp->content_transfer_encoding,
907 pp->must_ikvi =
false;
921 if ( (
NULL !=
pp->content_name) &&
924 free (
pp->content_name);
927 if ( (
NULL !=
pp->content_type) &&
930 free (
pp->content_type);
933 if ( (
NULL !=
pp->content_filename) &&
936 free (
pp->content_filename);
937 pp->content_filename =
NULL;
939 if ( (
NULL !=
pp->content_transfer_encoding) &&
942 free (
pp->content_transfer_encoding);
943 pp->content_transfer_encoding =
NULL;
967 buf = (
char *) &
pp[1];
972 ( (
pp->buffer_pos > 0) &&
977 max =
pp->buffer_size -
pp->buffer_pos;
984 pp->buffer_pos += max;
1019 if ( (
pp->buffer_pos > 1) &&
1046 pp->state =
pp->dash_state;
1095 pp->must_ikvi =
true;
1109 if ( (
NULL !=
pp->content_type) &&
1114 pp->nested_boundary =
strstr (
pp->content_type,
1116 if (
NULL ==
pp->nested_boundary)
1121 pp->nested_boundary =
1123 if (
NULL ==
pp->nested_boundary)
1131 free (
pp->content_type);
1139 pp->value_offset = 0;
1159 if (
NULL !=
pp->nested_boundary)
1161 free (
pp->nested_boundary);
1162 pp->nested_boundary =
NULL;
1168 if (
NULL ==
pp->nested_boundary)
1174 pp->nested_boundary,
1189 if (
NULL !=
pp->content_name)
1191 if (
NULL !=
pp->content_type)
1193 if (
NULL !=
pp->content_filename)
1195 if (
NULL !=
pp->content_transfer_encoding)
1201 pp->value_offset = 0;
1217 pp->nested_boundary,
1313 if ( (
pp->xbuf_pos > 0) ||
1321 if (
NULL !=
pp->nested_boundary)
1322 free (
pp->nested_boundary);
#define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA
#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED
_MHD_EXTERN enum MHD_Result MHD_destroy_post_processor(struct MHD_PostProcessor *pp)
_MHD_EXTERN enum MHD_Result MHD_post_process(struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len)
_MHD_EXTERN struct MHD_PostProcessor * MHD_create_post_processor(struct MHD_Connection *connection, size_t buffer_size, MHD_PostDataIterator iter, void *iter_cls)
_MHD_EXTERN enum MHD_Result MHD_lookup_connection_value_n(struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, size_t key_size, const char **value_ptr, size_t *value_size_ptr)
void MHD_unescape_plus(char *arg)
void * MHD_calloc_(size_t nelem, size_t elsize)
int MHD_str_equal_caseless_n_(const char *const str1, const char *const str2, size_t maxlen)
#define MHD_STATICSTR_LEN_(macro)
MHD internal shared structures.
Header for platform missing functions.
Header for string manipulating helpers.
_MHD_EXTERN size_t MHD_http_unescape(char *val)
enum MHD_Result(* MHD_PostDataIterator)(void *cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, uint64_t off, size_t size)
static enum MHD_Result post_process_multipart(struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len)
static int try_match_header(const char *prefix, size_t prefix_len, char *line, char **suffix)
static int find_boundary(struct MHD_PostProcessor *pp, const char *boundary, size_t blen, size_t *ioffptr, enum PP_State next_state, enum PP_State next_dash_state)
static int process_value_to_boundary(struct MHD_PostProcessor *pp, size_t *ioffptr, const char *boundary, size_t blen, enum PP_State next_state, enum PP_State next_dash_state)
static void process_value(struct MHD_PostProcessor *pp, const char *value_start, const char *value_end, const char *last_escape)
static void try_get_value(const char *buf, const char *key, char **destination)
static enum MHD_Result post_process_urlencoded(struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len)
static void free_unmarked(struct MHD_PostProcessor *pp)
static int process_multipart_headers(struct MHD_PostProcessor *pp, size_t *ioffptr, enum PP_State next_state)
Declarations for parsing POST data.
@ NE_content_transfer_encoding
@ PP_Nested_PerformMarking
@ PP_PerformCheckMultipart
@ PP_Nested_ProcessEntryHeaders
@ PP_Nested_PerformCleanup
@ PP_ProcessValueToBoundary
@ PP_Nested_ProcessValueToBoundary
enum MHD_CONNECTION_STATE state
struct MHD_Connection * connection