diff options
| -rw-r--r-- | activitypub.c | 6 | ||||
| -rw-r--r-- | data.c | 2 | ||||
| -rw-r--r-- | html.c | 6 | ||||
| -rw-r--r-- | httpd.c | 2 | ||||
| -rw-r--r-- | snac.h | 14 |
5 files changed, 17 insertions, 13 deletions
diff --git a/activitypub.c b/activitypub.c index 13b1ce2..86d33df 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -1426,7 +1426,7 @@ int process_queue(void) | |||
| 1426 | 1426 | ||
| 1427 | /** HTTP handlers */ | 1427 | /** HTTP handlers */ |
| 1428 | 1428 | ||
| 1429 | int activitypub_get_handler(d_char *req, char *q_path, | 1429 | int activitypub_get_handler(const xs_dict *req, const char *q_path, |
| 1430 | char **body, int *b_size, char **ctype) | 1430 | char **body, int *b_size, char **ctype) |
| 1431 | { | 1431 | { |
| 1432 | int status = 200; | 1432 | int status = 200; |
| @@ -1519,8 +1519,8 @@ int activitypub_get_handler(d_char *req, char *q_path, | |||
| 1519 | } | 1519 | } |
| 1520 | 1520 | ||
| 1521 | 1521 | ||
| 1522 | int activitypub_post_handler(d_char *req, char *q_path, | 1522 | int activitypub_post_handler(const xs_dict *req, const char *q_path, |
| 1523 | d_char *payload, int p_size, | 1523 | char *payload, int p_size, |
| 1524 | char **body, int *b_size, char **ctype) | 1524 | char **body, int *b_size, char **ctype) |
| 1525 | /* processes an input message */ | 1525 | /* processes an input message */ |
| 1526 | { | 1526 | { |
| @@ -1814,7 +1814,7 @@ static xs_dict *_new_qmsg(const char *type, const xs_val *msg, int retries) | |||
| 1814 | } | 1814 | } |
| 1815 | 1815 | ||
| 1816 | 1816 | ||
| 1817 | void enqueue_input(snac *snac, xs_dict *msg, xs_dict *req, int retries) | 1817 | void enqueue_input(snac *snac, const xs_dict *msg, const xs_dict *req, int retries) |
| 1818 | /* enqueues an input message */ | 1818 | /* enqueues an input message */ |
| 1819 | { | 1819 | { |
| 1820 | xs *qmsg = _new_qmsg("input", msg, retries); | 1820 | xs *qmsg = _new_qmsg("input", msg, retries); |
| @@ -1289,7 +1289,8 @@ xs_str *html_notifications(snac *snac) | |||
| 1289 | } | 1289 | } |
| 1290 | 1290 | ||
| 1291 | 1291 | ||
| 1292 | int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char **ctype) | 1292 | int html_get_handler(const xs_dict *req, const char *q_path, |
| 1293 | char **body, int *b_size, char **ctype) | ||
| 1293 | { | 1294 | { |
| 1294 | char *accept = xs_dict_get(req, "accept"); | 1295 | char *accept = xs_dict_get(req, "accept"); |
| 1295 | int status = 404; | 1296 | int status = 404; |
| @@ -1546,7 +1547,8 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char * | |||
| 1546 | } | 1547 | } |
| 1547 | 1548 | ||
| 1548 | 1549 | ||
| 1549 | int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, | 1550 | int html_post_handler(const xs_dict *req, const char *q_path, |
| 1551 | char *payload, int p_size, | ||
| 1550 | char **body, int *b_size, char **ctype) | 1552 | char **body, int *b_size, char **ctype) |
| 1551 | { | 1553 | { |
| 1552 | int status = 0; | 1554 | int status = 0; |
| @@ -43,7 +43,7 @@ d_char *nodeinfo_2_0(void) | |||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | int server_get_handler(d_char *req, char *q_path, | 46 | int server_get_handler(xs_dict *req, char *q_path, |
| 47 | char **body, int *b_size, char **ctype) | 47 | char **body, int *b_size, char **ctype) |
| 48 | /* basic server services */ | 48 | /* basic server services */ |
| 49 | { | 49 | { |
| @@ -155,7 +155,7 @@ void inbox_add(const char *inbox); | |||
| 155 | void inbox_add_by_actor(const xs_dict *actor); | 155 | void inbox_add_by_actor(const xs_dict *actor); |
| 156 | xs_list *inbox_list(void); | 156 | xs_list *inbox_list(void); |
| 157 | 157 | ||
| 158 | void enqueue_input(snac *snac, xs_dict *msg, xs_dict *req, int retries); | 158 | void enqueue_input(snac *snac, const xs_dict *msg, const xs_dict *req, int retries); |
| 159 | void enqueue_output_raw(const char *keyid, const char *seckey, | 159 | void enqueue_output_raw(const char *keyid, const char *seckey, |
| 160 | xs_dict *msg, xs_str *inbox, int retries); | 160 | xs_dict *msg, xs_str *inbox, int retries); |
| 161 | void enqueue_output(snac *snac, xs_dict *msg, xs_str *inbox, int retries); | 161 | void enqueue_output(snac *snac, xs_dict *msg, xs_str *inbox, int retries); |
| @@ -187,7 +187,7 @@ int check_signature(snac *snac, xs_dict *req, xs_str **err); | |||
| 187 | void httpd(void); | 187 | void httpd(void); |
| 188 | 188 | ||
| 189 | int webfinger_request(const char *qs, char **actor, char **user); | 189 | int webfinger_request(const char *qs, char **actor, char **user); |
| 190 | int webfinger_get_handler(d_char *req, char *q_path, | 190 | int webfinger_get_handler(xs_dict *req, char *q_path, |
| 191 | char **body, int *b_size, char **ctype); | 191 | char **body, int *b_size, char **ctype); |
| 192 | 192 | ||
| 193 | const char *default_avatar_base64(void); | 193 | const char *default_avatar_base64(void); |
| @@ -220,17 +220,19 @@ int process_user_queue(snac *snac); | |||
| 220 | void process_queue_item(xs_dict *q_item); | 220 | void process_queue_item(xs_dict *q_item); |
| 221 | int process_queue(void); | 221 | int process_queue(void); |
| 222 | 222 | ||
| 223 | int activitypub_get_handler(d_char *req, char *q_path, | 223 | int activitypub_get_handler(const xs_dict *req, const char *q_path, |
| 224 | char **body, int *b_size, char **ctype); | 224 | char **body, int *b_size, char **ctype); |
| 225 | int activitypub_post_handler(d_char *req, char *q_path, | 225 | int activitypub_post_handler(const xs_dict *req, const char *q_path, |
| 226 | char *payload, int p_size, | 226 | char *payload, int p_size, |
| 227 | char **body, int *b_size, char **ctype); | 227 | char **body, int *b_size, char **ctype); |
| 228 | 228 | ||
| 229 | d_char *not_really_markdown(const char *content); | 229 | d_char *not_really_markdown(const char *content); |
| 230 | d_char *sanitize(const char *str); | 230 | d_char *sanitize(const char *str); |
| 231 | 231 | ||
| 232 | int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char **ctype); | 232 | int html_get_handler(const xs_dict *req, const char *q_path, |
| 233 | int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, | 233 | char **body, int *b_size, char **ctype); |
| 234 | int html_post_handler(const xs_dict *req, const char *q_path, | ||
| 235 | char *payload, int p_size, | ||
| 234 | char **body, int *b_size, char **ctype); | 236 | char **body, int *b_size, char **ctype); |
| 235 | 237 | ||
| 236 | int snac_init(const char *_basedir); | 238 | int snac_init(const char *_basedir); |