diff options
| author | 2022-09-23 20:28:23 +0200 | |
|---|---|---|
| committer | 2022-09-23 20:28:23 +0200 | |
| commit | 1d694a245a56bb4fd90fd917ad3648c2c5449746 (patch) | |
| tree | cb96eb621ca84ebfdfba40cf859af477639f75d6 /httpd.c | |
| parent | New function process_queue(). (diff) | |
| download | snac2-1d694a245a56bb4fd90fd917ad3648c2c5449746.tar.gz snac2-1d694a245a56bb4fd90fd917ad3648c2c5449746.tar.xz snac2-1d694a245a56bb4fd90fd917ad3648c2c5449746.zip | |
xs_httpd_request() also returns the payload.
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -98,11 +98,13 @@ void httpd_connection(int rs) | |||
| 98 | char *ctype = NULL; | 98 | char *ctype = NULL; |
| 99 | xs *headers = NULL; | 99 | xs *headers = NULL; |
| 100 | xs *q_path = NULL; | 100 | xs *q_path = NULL; |
| 101 | xs *payload = NULL; | ||
| 102 | int p_size; | ||
| 101 | char *p; | 103 | char *p; |
| 102 | 104 | ||
| 103 | f = xs_socket_accept(rs); | 105 | f = xs_socket_accept(rs); |
| 104 | 106 | ||
| 105 | req = xs_httpd_request(f); | 107 | req = xs_httpd_request(f, &payload, &p_size); |
| 106 | 108 | ||
| 107 | { | 109 | { |
| 108 | xs *j = xs_json_dumps_pp(req, 4); | 110 | xs *j = xs_json_dumps_pp(req, 4); |
| @@ -132,6 +134,9 @@ void httpd_connection(int rs) | |||
| 132 | } | 134 | } |
| 133 | else | 135 | else |
| 134 | if (strcmp(method, "POST") == 0) { | 136 | if (strcmp(method, "POST") == 0) { |
| 137 | if (status == 0) | ||
| 138 | status = activitypub_post_handler(req, q_path, | ||
| 139 | payload, p_size, &body, &b_size, &ctype); | ||
| 135 | } | 140 | } |
| 136 | 141 | ||
| 137 | /* let's go */ | 142 | /* let's go */ |