aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd')
-rw-r--r--src/microhttpd/daemon.c22
-rw-r--r--src/microhttpd/internal.c6
-rw-r--r--src/microhttpd/internal.h16
-rw-r--r--src/microhttpd/postprocessor.c4
4 files changed, 24 insertions, 24 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 484df542..c120e3a0 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2743,6 +2743,26 @@ MHD_select_thread (void *cls)
2743 2743
2744 2744
2745/** 2745/**
2746 * Process escape sequences ('%HH') Updates val in place; the
2747 * result should be UTF-8 encoded and cannot be larger than the input.
2748 * The result must also still be 0-terminated.
2749 *
2750 * @param cls closure (use NULL)
2751 * @param connection handle to connection, not used
2752 * @param val value to unescape (modified in the process)
2753 * @return length of the resulting val (strlen(val) maybe
2754 * shorter afterwards due to elimination of escape sequences)
2755 */
2756static size_t
2757unescape_wrapper (void *cls,
2758 struct MHD_Connection *connection,
2759 char *val)
2760{
2761 return MHD_http_unescape (val);
2762}
2763
2764
2765/**
2746 * Start a webserver on the given port. Variadic version of 2766 * Start a webserver on the given port. Variadic version of
2747 * #MHD_start_daemon_va. 2767 * #MHD_start_daemon_va.
2748 * 2768 *
@@ -3410,7 +3430,7 @@ MHD_start_daemon_va (unsigned int flags,
3410 daemon->connection_limit = MHD_MAX_CONNECTIONS_DEFAULT; 3430 daemon->connection_limit = MHD_MAX_CONNECTIONS_DEFAULT;
3411 daemon->pool_size = MHD_POOL_SIZE_DEFAULT; 3431 daemon->pool_size = MHD_POOL_SIZE_DEFAULT;
3412 daemon->pool_increment = MHD_BUF_INC_SIZE; 3432 daemon->pool_increment = MHD_BUF_INC_SIZE;
3413 daemon->unescape_callback = &MHD_http_unescape; 3433 daemon->unescape_callback = &unescape_wrapper;
3414 daemon->connection_timeout = 0; /* no timeout */ 3434 daemon->connection_timeout = 0; /* no timeout */
3415 daemon->wpipe[0] = MHD_INVALID_PIPE_; 3435 daemon->wpipe[0] = MHD_INVALID_PIPE_;
3416 daemon->wpipe[1] = MHD_INVALID_PIPE_; 3436 daemon->wpipe[1] = MHD_INVALID_PIPE_;
diff --git a/src/microhttpd/internal.c b/src/microhttpd/internal.c
index 37ba1471..5039c32d 100644
--- a/src/microhttpd/internal.c
+++ b/src/microhttpd/internal.c
@@ -124,16 +124,12 @@ MHD_unescape_plus (char *arg)
124 * result should be UTF-8 encoded and cannot be larger than the input. 124 * result should be UTF-8 encoded and cannot be larger than the input.
125 * The result must also still be 0-terminated. 125 * The result must also still be 0-terminated.
126 * 126 *
127 * @param cls closure (use NULL)
128 * @param connection handle to connection, not used
129 * @param val value to unescape (modified in the process) 127 * @param val value to unescape (modified in the process)
130 * @return length of the resulting val (strlen(val) maybe 128 * @return length of the resulting val (strlen(val) maybe
131 * shorter afterwards due to elimination of escape sequences) 129 * shorter afterwards due to elimination of escape sequences)
132 */ 130 */
133size_t 131size_t
134MHD_http_unescape (void *cls, 132MHD_http_unescape (char *val)
135 struct MHD_Connection *connection,
136 char *val)
137{ 133{
138 char *rpos = val; 134 char *rpos = val;
139 char *wpos = val; 135 char *wpos = val;
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 4b25ccb3..4d80d556 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -199,22 +199,6 @@ MHD_DLOG (const struct MHD_Daemon *daemon,
199 const char *format, ...); 199 const char *format, ...);
200#endif 200#endif
201 201
202/**
203 * Process escape sequences ('+'=space, %HH) Updates val in place; the
204 * result should be UTF-8 encoded and cannot be larger than the input.
205 * The result must also still be 0-terminated.
206 *
207 * @param cls closure (use NULL)
208 * @param connection handle to connection, not used
209 * @param val value to unescape (modified in the process)
210 * @return length of the resulting val (strlen(val) maybe
211 * shorter afterwards due to elimination of escape sequences)
212 */
213size_t
214MHD_http_unescape (void *cls,
215 struct MHD_Connection *connection,
216 char *val);
217
218 202
219/** 203/**
220 * Header or cookie in HTTP request or response. 204 * Header or cookie in HTTP request or response.
diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
index 6512c603..95c7938f 100644
--- a/src/microhttpd/postprocessor.c
+++ b/src/microhttpd/postprocessor.c
@@ -382,7 +382,7 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
382 buf[pp->buffer_pos] = '\0'; /* 0-terminate key */ 382 buf[pp->buffer_pos] = '\0'; /* 0-terminate key */
383 pp->buffer_pos = 0; /* reset for next key */ 383 pp->buffer_pos = 0; /* reset for next key */
384 MHD_unescape_plus (buf); 384 MHD_unescape_plus (buf);
385 MHD_http_unescape (NULL, NULL, buf); 385 MHD_http_unescape (buf);
386 poff += equals + 1; 386 poff += equals + 1;
387 pp->state = PP_ProcessValue; 387 pp->state = PP_ProcessValue;
388 pp->value_offset = 0; 388 pp->value_offset = 0;
@@ -443,7 +443,7 @@ post_process_urlencoded (struct MHD_PostProcessor *pp,
443 /* unescape */ 443 /* unescape */
444 xbuf[xoff] = '\0'; /* 0-terminate in preparation */ 444 xbuf[xoff] = '\0'; /* 0-terminate in preparation */
445 MHD_unescape_plus (xbuf); 445 MHD_unescape_plus (xbuf);
446 xoff = MHD_http_unescape (NULL, NULL, xbuf); 446 xoff = MHD_http_unescape (xbuf);
447 /* finally: call application! */ 447 /* finally: call application! */
448 pp->must_ikvi = MHD_NO; 448 pp->must_ikvi = MHD_NO;
449 if (MHD_NO == pp->ikvi (pp->cls, MHD_POSTDATA_KIND, (const char *) &pp[1], /* key */ 449 if (MHD_NO == pp->ikvi (pp->cls, MHD_POSTDATA_KIND, (const char *) &pp[1], /* key */