internal.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #include "internal.h"
00028
00029 #if HAVE_MESSAGES
00030
00034 void
00035 MHD_DLOG (const struct MHD_Daemon *daemon, const char *format, ...)
00036 {
00037 va_list va;
00038
00039 if ((daemon->options & MHD_USE_DEBUG) == 0)
00040 return;
00041 va_start (va, format);
00042 VFPRINTF (stderr, format, va);
00043 va_end (va);
00044 }
00045 #endif
00046
00050 void
00051 MHD_http_unescape (char *val)
00052 {
00053 char *esc;
00054 unsigned int num;
00055
00056 while (NULL != (esc = strstr (val, "+")))
00057 *esc = ' ';
00058 while (NULL != (esc = strstr (val, "%")))
00059 {
00060 if ((1 == sscanf (&esc[1],
00061 "%2x", &num)) || (1 == sscanf (&esc[1], "%2X", &num)))
00062 {
00063 esc[0] = (unsigned char) num;
00064 memmove (&esc[1], &esc[3], strlen (&esc[3]) + 1);
00065 }
00066 val = esc + 1;
00067 }
00068 }