commit 753eadf
default
·
2023-05-04 07:25:09 +0000 UTC
parent 511f506
Added some const here and there.
5 files changed,
+17,
-13
+3,
-3
1@@ -1426,7 +1426,7 @@ int process_queue(void)
2
3 /** HTTP handlers */
4
5-int activitypub_get_handler(d_char *req, char *q_path,
6+int activitypub_get_handler(const xs_dict *req, const char *q_path,
7 char **body, int *b_size, char **ctype)
8 {
9 int status = 200;
10@@ -1519,8 +1519,8 @@ int activitypub_get_handler(d_char *req, char *q_path,
11 }
12
13
14-int activitypub_post_handler(d_char *req, char *q_path,
15- d_char *payload, int p_size,
16+int activitypub_post_handler(const xs_dict *req, const char *q_path,
17+ char *payload, int p_size,
18 char **body, int *b_size, char **ctype)
19 /* processes an input message */
20 {
M
data.c
+1,
-1
1@@ -1814,7 +1814,7 @@ static xs_dict *_new_qmsg(const char *type, const xs_val *msg, int retries)
2 }
3
4
5-void enqueue_input(snac *snac, xs_dict *msg, xs_dict *req, int retries)
6+void enqueue_input(snac *snac, const xs_dict *msg, const xs_dict *req, int retries)
7 /* enqueues an input message */
8 {
9 xs *qmsg = _new_qmsg("input", msg, retries);
M
html.c
+4,
-2
1@@ -1289,7 +1289,8 @@ xs_str *html_notifications(snac *snac)
2 }
3
4
5-int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char **ctype)
6+int html_get_handler(const xs_dict *req, const char *q_path,
7+ char **body, int *b_size, char **ctype)
8 {
9 char *accept = xs_dict_get(req, "accept");
10 int status = 404;
11@@ -1546,7 +1547,8 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char *
12 }
13
14
15-int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
16+int html_post_handler(const xs_dict *req, const char *q_path,
17+ char *payload, int p_size,
18 char **body, int *b_size, char **ctype)
19 {
20 int status = 0;
M
httpd.c
+1,
-1
1@@ -43,7 +43,7 @@ d_char *nodeinfo_2_0(void)
2 }
3
4
5-int server_get_handler(d_char *req, char *q_path,
6+int server_get_handler(xs_dict *req, char *q_path,
7 char **body, int *b_size, char **ctype)
8 /* basic server services */
9 {
M
snac.h
+8,
-6
1@@ -155,7 +155,7 @@ void inbox_add(const char *inbox);
2 void inbox_add_by_actor(const xs_dict *actor);
3 xs_list *inbox_list(void);
4
5-void enqueue_input(snac *snac, xs_dict *msg, xs_dict *req, int retries);
6+void enqueue_input(snac *snac, const xs_dict *msg, const xs_dict *req, int retries);
7 void enqueue_output_raw(const char *keyid, const char *seckey,
8 xs_dict *msg, xs_str *inbox, int retries);
9 void enqueue_output(snac *snac, xs_dict *msg, xs_str *inbox, int retries);
10@@ -187,7 +187,7 @@ int check_signature(snac *snac, xs_dict *req, xs_str **err);
11 void httpd(void);
12
13 int webfinger_request(const char *qs, char **actor, char **user);
14-int webfinger_get_handler(d_char *req, char *q_path,
15+int webfinger_get_handler(xs_dict *req, char *q_path,
16 char **body, int *b_size, char **ctype);
17
18 const char *default_avatar_base64(void);
19@@ -220,17 +220,19 @@ int process_user_queue(snac *snac);
20 void process_queue_item(xs_dict *q_item);
21 int process_queue(void);
22
23-int activitypub_get_handler(d_char *req, char *q_path,
24+int activitypub_get_handler(const xs_dict *req, const char *q_path,
25 char **body, int *b_size, char **ctype);
26-int activitypub_post_handler(d_char *req, char *q_path,
27+int activitypub_post_handler(const xs_dict *req, const char *q_path,
28 char *payload, int p_size,
29 char **body, int *b_size, char **ctype);
30
31 d_char *not_really_markdown(const char *content);
32 d_char *sanitize(const char *str);
33
34-int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char **ctype);
35-int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
36+int html_get_handler(const xs_dict *req, const char *q_path,
37+ char **body, int *b_size, char **ctype);
38+int html_post_handler(const xs_dict *req, const char *q_path,
39+ char *payload, int p_size,
40 char **body, int *b_size, char **ctype);
41
42 int snac_init(const char *_basedir);