summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authorGravatar default2023-04-21 23:17:58 +0200
committerGravatar default2023-04-21 23:17:58 +0200
commit526d4e8abb27127625a228796dc9c196efcfa8bf (patch)
tree76a5c05240474df1fdfc5902bdb0fe6d70cdd203 /httpd.c
parentMerge branch 'master' of /home/angel/git/snac2 (diff)
downloadsnac2-526d4e8abb27127625a228796dc9c196efcfa8bf.tar.gz
snac2-526d4e8abb27127625a228796dc9c196efcfa8bf.tar.xz
snac2-526d4e8abb27127625a228796dc9c196efcfa8bf.zip
Added a new compilation variable NO_MASTODON_API.
The Mastodon API is a big and ugly beast; if you don't want it in your snac, you can compile it out by running make CFLAGS=-DNO_MASTODON_API And your snac binary will be as slim as always.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/httpd.c b/httpd.c
index 11f2c28..3168323 100644
--- a/httpd.c
+++ b/httpd.c
@@ -183,17 +183,21 @@ void httpd_connection(FILE *f)
183 if (status == 0) 183 if (status == 0)
184 status = activitypub_get_handler(req, q_path, &body, &b_size, &ctype); 184 status = activitypub_get_handler(req, q_path, &body, &b_size, &ctype);
185 185
186#ifndef NO_MASTODON_API
186 if (status == 0) 187 if (status == 0)
187 status = oauth_get_handler(req, q_path, &body, &b_size, &ctype); 188 status = oauth_get_handler(req, q_path, &body, &b_size, &ctype);
188 189
189 if (status == 0) 190 if (status == 0)
190 status = mastoapi_get_handler(req, q_path, &body, &b_size, &ctype); 191 status = mastoapi_get_handler(req, q_path, &body, &b_size, &ctype);
192#endif /* NO_MASTODON_API */
191 193
192 if (status == 0) 194 if (status == 0)
193 status = html_get_handler(req, q_path, &body, &b_size, &ctype); 195 status = html_get_handler(req, q_path, &body, &b_size, &ctype);
194 } 196 }
195 else 197 else
196 if (strcmp(method, "POST") == 0) { 198 if (strcmp(method, "POST") == 0) {
199
200#ifndef NO_MASTODON_API
197 if (status == 0) 201 if (status == 0)
198 status = oauth_post_handler(req, q_path, 202 status = oauth_post_handler(req, q_path,
199 payload, p_size, &body, &b_size, &ctype); 203 payload, p_size, &body, &b_size, &ctype);
@@ -201,6 +205,7 @@ void httpd_connection(FILE *f)
201 if (status == 0) 205 if (status == 0)
202 status = mastoapi_post_handler(req, q_path, 206 status = mastoapi_post_handler(req, q_path,
203 payload, p_size, &body, &b_size, &ctype); 207 payload, p_size, &body, &b_size, &ctype);
208#endif
204 209
205 if (status == 0) 210 if (status == 0)
206 status = activitypub_post_handler(req, q_path, 211 status = activitypub_post_handler(req, q_path,