snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 9a38cfb70f40dcfd1c2980448bf4c6f594f8db64
parent 2766fbd49cfba346dbaea1914adc4118e1176e1e
Author: default <nobody@localhost>
Date:   Tue, 20 Sep 2022 20:12:21 +0200

[http.c] new file.

Diffstat:
MMakefile | 4+++-
Ahttp.c | 20++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -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 diff --git a/http.c b/http.c @@ -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); +}