summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-09-23 20:28:23 +0200
committerdefault <nobody@localhost>2022-09-23 20:28:23 +0200
commit1d694a245a56bb4fd90fd917ad3648c2c5449746 (patch)
treecb96eb621ca84ebfdfba40cf859af477639f75d6 /httpd.c
parentbbf5471039a973fed918441150ef76ff0db7682a (diff)
xs_httpd_request() also returns the payload.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/httpd.c b/httpd.c
index 1ef766c..037f690 100644
--- a/httpd.c
+++ b/httpd.c
@@ -98,11 +98,13 @@ void httpd_connection(int rs)
char *ctype = NULL;
xs *headers = NULL;
xs *q_path = NULL;
+ xs *payload = NULL;
+ int p_size;
char *p;
f = xs_socket_accept(rs);
- req = xs_httpd_request(f);
+ req = xs_httpd_request(f, &payload, &p_size);
{
xs *j = xs_json_dumps_pp(req, 4);
@@ -132,6 +134,9 @@ void httpd_connection(int rs)
}
else
if (strcmp(method, "POST") == 0) {
+ if (status == 0)
+ status = activitypub_post_handler(req, q_path,
+ payload, p_size, &body, &b_size, &ctype);
}
/* let's go */