snac2

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

commit 595ded1fc7999008a09a9370c69c8a9f9f9a28fb
parent 7a60c71744f94edc66994537fddafaf0db594fb5
Author: default <nobody@localhost>
Date:   Thu, 22 Sep 2022 17:55:59 +0200

httpd serves susie.png.

Diffstat:
Mhttpd.c | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/httpd.c b/httpd.c @@ -10,6 +10,14 @@ #include "snac.h" +/* susie.png */ +const char *susie = + "iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAAC" + "CEkxzAAAAUUlEQVQoz43R0QkAMQwCUDdw/y3dwE" + "vsvzlL4X1IoQkAisKmwfAFT3RgJHbQezpSRoXEq" + "eqCL9BJBf7h3QbOCCxV5EVWMEMwG7K1/WODtlvx" + "AYTtEsDU9F34AAAAAElFTkSuQmCC"; + void server_get_handler(d_char *req, char *q_path, int *status, char **body, int *b_size, char **ctype) @@ -67,6 +75,12 @@ void server_get_handler(d_char *req, char *q_path, int *status, *body = s; } } + else + if (strcmp(q_path, "/susie.png") == 0) { + *status = 200; + *body = xs_base64_dec(susie, b_size); + *ctype = "image/png"; + } } void httpd_connection(int rs)