From 1d694a245a56bb4fd90fd917ad3648c2c5449746 Mon Sep 17 00:00:00 2001 From: default Date: Fri, 23 Sep 2022 20:28:23 +0200 Subject: xs_httpd_request() also returns the payload. --- httpd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'httpd.c') 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 */ -- cgit v1.2.3