summaryrefslogtreecommitdiff
path: root/xs_httpd.h
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-12-11 09:46:27 +0100
committerdefault <nobody@localhost>2022-12-11 09:46:27 +0100
commit0337c71cf45e9b646c1cd4cb39426073623267f2 (patch)
tree95c0ee6d991342c8057e0705d55526967282477b /xs_httpd.h
parent79270abd09689e9a7532590e3aa1c016b8cb96c9 (diff)
Backport from xs.
Diffstat (limited to 'xs_httpd.h')
-rw-r--r--xs_httpd.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/xs_httpd.h b/xs_httpd.h
index 89ab57a..454d786 100644
--- a/xs_httpd.h
+++ b/xs_httpd.h
@@ -69,8 +69,6 @@ d_char *xs_url_vars(char *str)
}
-void *memmem(const void *, size_t, const void *, size_t);
-
d_char *_xs_multipart_form_data(char *payload, int p_size, char *header)
/* parses a multipart/form-data payload */
{
@@ -94,7 +92,7 @@ d_char *_xs_multipart_form_data(char *payload, int p_size, char *header)
d_char *p_vars = xs_dict_new();
/* iterate searching the boundaries */
- while ((p = memmem(payload + offset, p_size - offset, boundary, bsz)) != NULL) {
+ while ((p = xs_memmem(payload + offset, p_size - offset, boundary, bsz)) != NULL) {
xs *s1 = NULL;
xs *l1 = NULL;
char *vn = NULL;
@@ -133,13 +131,13 @@ d_char *_xs_multipart_form_data(char *payload, int p_size, char *header)
}
/* find the start of the part content */
- if ((p = memmem(p, p_size - offset, "\r\n\r\n", 4)) == NULL)
+ if ((p = xs_memmem(p, p_size - offset, "\r\n\r\n", 4)) == NULL)
break;
p += 4;
/* find the next boundary */
- if ((q = memmem(p, p_size - offset, boundary, bsz)) == NULL)
+ if ((q = xs_memmem(p, p_size - offset, boundary, bsz)) == NULL)
break;
po = p - payload;