diff options
author | Christian Grothoff <christian@grothoff.org> | 2007-09-09 03:56:10 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2007-09-09 03:56:10 +0000 |
commit | 21acb929f578eb8f876c235669b78d6b213ec315 (patch) | |
tree | 45f89714c45e2a4f0999f2601fb8df7076f5b4fd /src/daemon/internal.c | |
parent | 5e828bda99ed11ae9f183965eece0b5931ec0270 (diff) | |
download | libmicrohttpd-21acb929f578eb8f876c235669b78d6b213ec315.tar.gz libmicrohttpd-21acb929f578eb8f876c235669b78d6b213ec315.zip |
incremental post processing API and implementation
Diffstat (limited to 'src/daemon/internal.c')
-rw-r--r-- | src/daemon/internal.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/daemon/internal.c b/src/daemon/internal.c index 0407cfa9..85c17b16 100644 --- a/src/daemon/internal.c +++ b/src/daemon/internal.c | |||
@@ -42,3 +42,26 @@ MHD_DLOG (const struct MHD_Daemon *daemon, const char *format, ...) | |||
42 | VFPRINTF (stderr, format, va); | 42 | VFPRINTF (stderr, format, va); |
43 | va_end (va); | 43 | va_end (va); |
44 | } | 44 | } |
45 | |||
46 | /** | ||
47 | * Process escape sequences ('+'=space, %HH) | ||
48 | */ | ||
49 | void | ||
50 | MHD_http_unescape (char *val) | ||
51 | { | ||
52 | char *esc; | ||
53 | unsigned int num; | ||
54 | |||
55 | while (NULL != (esc = strstr (val, "+"))) | ||
56 | *esc = ' '; | ||
57 | while (NULL != (esc = strstr (val, "%"))) | ||
58 | { | ||
59 | if ((1 == sscanf (&esc[1], | ||
60 | "%2x", &num)) || (1 == sscanf (&esc[1], "%2X", &num))) | ||
61 | { | ||
62 | esc[0] = (unsigned char) num; | ||
63 | memmove (&esc[1], &esc[3], strlen (&esc[3])); | ||
64 | } | ||
65 | val = esc + 1; | ||
66 | } | ||
67 | } | ||