GNU libmicrohttpd  0.9.29
internal.c File Reference

internal shared structures More...

#include "internal.h"
#include "mhd_str.h"
Include dependency graph for internal.c:

Go to the source code of this file.

Functions

void MHD_unescape_plus (char *arg)
 
size_t MHD_http_unescape (char *val)
 
int MHD_parse_arguments_ (struct MHD_Connection *connection, enum MHD_ValueKind kind, char *args, MHD_ArgumentIterator_ cb, unsigned int *num_headers)
 

Detailed Description

internal shared structures

Author
Daniel Pittman
Christian Grothoff

Definition in file internal.c.

Function Documentation

◆ MHD_http_unescape()

size_t MHD_http_unescape ( char *  val)

Process escape sequences ('HH') Updates val in place; the result should be UTF-8 encoded and cannot be larger than the input. The result must also still be 0-terminated.

Parameters
valvalue to unescape (modified in the process)
Returns
length of the resulting val (strlen(val) maybe shorter afterwards due to elimination of escape sequences)

Definition at line 138 of file internal.c.

References MHD_strx_to_uint32_n_().

Referenced by post_process_urlencoded(), and unescape_wrapper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MHD_parse_arguments_()

int MHD_parse_arguments_ ( struct MHD_Connection connection,
enum MHD_ValueKind  kind,
char *  args,
MHD_ArgumentIterator_  cb,
unsigned int *  num_headers 
)

Parse and unescape the arguments given by the client as part of the HTTP request URI.

Parameters
kindheader kind to pass to cb
connectionconnection to add headers to
[in|out]args argument URI string (after "?" in URI), clobbered in the process!
cbfunction to call on each key-value pair found
[out]num_headersset to the number of headers found
Returns
MHD_NO on failure (cb returned MHD_NO), MHD_YES for success (parsing succeeded, cb always returned MHD_YES)

Definition at line 186 of file internal.c.

References MHD_Connection::daemon, MHD_NO, MHD_unescape_plus(), MHD_YES, NULL, MHD_Daemon::unescape_callback, and MHD_Daemon::unescape_callback_cls.

Referenced by check_argument_match(), and parse_initial_message_line().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MHD_unescape_plus()

void MHD_unescape_plus ( char *  arg)

Convert all occurrences of '+' to ' '.

Parameters
argstring that is modified (in place), must be 0-terminated

Definition at line 119 of file internal.c.

References NULL.

Referenced by MHD_parse_arguments_(), and post_process_urlencoded().

Here is the caller graph for this function: