GNU libmicrohttpd  0.9.72
internal.c File Reference
#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)
 
bool MHD_parse_arguments_ (struct MHD_Request *request, enum MHD_ValueKind kind, char *args, MHD_ArgumentIterator_ cb, unsigned int *num_headers)
 

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 142 of file internal.c.

◆ MHD_parse_arguments_()

bool MHD_parse_arguments_ ( struct MHD_Request request,
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
requestrequest to add headers to
kindheader kind to pass to cb
[in,out]argsargument 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
false on failure (cb returned false), true for success (parsing succeeded, cb always returned true)

Definition at line 190 of file internal.c.

References MHD_Request::daemon, MHD_unescape_plus(), NULL, MHD_Daemon::unescape_cb, and MHD_Daemon::unescape_cb_cls.

Referenced by 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 123 of file internal.c.

References NULL.

Referenced by MHD_parse_arguments_(), post_process_urlencoded(), and process_value().

Here is the caller graph for this function: