diff options
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) |