[http.c] new file.

This commit is contained in:
default 2022-09-20 20:12:21 +02:00
parent 2766fbd49c
commit 9a38cfb70f
2 changed files with 23 additions and 1 deletions

View File

@ -2,7 +2,7 @@ CFLAGS=-g -Wall
all: snac
snac: snac.o main.o data.o
snac: snac.o main.o data.o http.o
$(CC) -L/usr/local/lib *.o -lcurl -lcrypto -o $@
.c.o:
@ -17,3 +17,5 @@ snac.o: snac.c snac.h \
main.o: main.c snac.h xs.h
data.o: data.c snac.h xs.h xs_json.h
http.o: http.c snac.h xs.h xs_io.h xs_encdec.h xs_openssl.h xs_curl.h

20
http.c Normal file
View File

@ -0,0 +1,20 @@
/* snac - A simple, minimalistic ActivityPub instance */
/* copyright (c) 2022 grunfink - MIT license */
#include "xs.h"
#include "xs_io.h"
#include "xs_encdec.h"
#include "xs_openssl.h"
#include "xs_curl.h"
#include "snac.h"
d_char *http_signed_request(snac *snac, char *method, char *url,
d_char *headers,
d_char *body, int b_size,
int *status, d_char **payload, int *p_size)
/* does an HTTP request */
{
return xs_http_request(method, url, headers,
body, b_size, status, payload, p_size);
}