diff options
| author | 2022-09-22 17:55:59 +0200 | |
|---|---|---|
| committer | 2022-09-22 17:55:59 +0200 | |
| commit | 595ded1fc7999008a09a9370c69c8a9f9f9a28fb (patch) | |
| tree | 7bf57d4a787c824288ae05935e06cbd77841b603 /httpd.c | |
| parent | Fixed memleak in greeting. (diff) | |
| download | penes-snac2-595ded1fc7999008a09a9370c69c8a9f9f9a28fb.tar.gz penes-snac2-595ded1fc7999008a09a9370c69c8a9f9f9a28fb.tar.xz penes-snac2-595ded1fc7999008a09a9370c69c8a9f9f9a28fb.zip | |
httpd serves susie.png.
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 14 |
1 files changed, 14 insertions, 0 deletions
| @@ -10,6 +10,14 @@ | |||
| 10 | 10 | ||
| 11 | #include "snac.h" | 11 | #include "snac.h" |
| 12 | 12 | ||
| 13 | /* susie.png */ | ||
| 14 | const char *susie = | ||
| 15 | "iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQAAAAC" | ||
| 16 | "CEkxzAAAAUUlEQVQoz43R0QkAMQwCUDdw/y3dwE" | ||
| 17 | "vsvzlL4X1IoQkAisKmwfAFT3RgJHbQezpSRoXEq" | ||
| 18 | "eqCL9BJBf7h3QbOCCxV5EVWMEMwG7K1/WODtlvx" | ||
| 19 | "AYTtEsDU9F34AAAAAElFTkSuQmCC"; | ||
| 20 | |||
| 13 | 21 | ||
| 14 | void server_get_handler(d_char *req, char *q_path, int *status, | 22 | void server_get_handler(d_char *req, char *q_path, int *status, |
| 15 | char **body, int *b_size, char **ctype) | 23 | char **body, int *b_size, char **ctype) |
| @@ -67,6 +75,12 @@ void server_get_handler(d_char *req, char *q_path, int *status, | |||
| 67 | *body = s; | 75 | *body = s; |
| 68 | } | 76 | } |
| 69 | } | 77 | } |
| 78 | else | ||
| 79 | if (strcmp(q_path, "/susie.png") == 0) { | ||
| 80 | *status = 200; | ||
| 81 | *body = xs_base64_dec(susie, b_size); | ||
| 82 | *ctype = "image/png"; | ||
| 83 | } | ||
| 70 | } | 84 | } |
| 71 | 85 | ||
| 72 | void httpd_connection(int rs) | 86 | void httpd_connection(int rs) |