GNU libmicrohttpd 0.9.77
Loading...
Searching...
No Matches
internal.c File Reference
#include "internal.h"
#include "mhd_str.h"

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_HTTP_OK, MHD_unescape_plus(), NULL, MHD_Daemon::unescape_cb, and MHD_Daemon::unescape_cb_cls.

Referenced by check_argument_match(), parse_initial_message_line(), and parse_initial_message_line().

◆ 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 MHD_HTTP_OK, and NULL.

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