summaryrefslogtreecommitdiffstats
path: root/app/httpd.c
diff options
context:
space:
mode:
authorroot <root@ka-ata-killa.ourano.james.local>2021-03-21 00:24:14 +0000
committerroot <root@ka-ata-killa.ourano.james.local>2021-03-21 00:24:14 +0000
commitac7e8b2318a0e118d4cb7ced49d109c40908cb85 (patch)
tree91d8ec03cb9552a47db467b5c0f9c5bea68b6473 /app/httpd.c
parent8c8218f878609af4719252d16ac0f42bccd9ba5b (diff)
downloadclock-ac7e8b2318a0e118d4cb7ced49d109c40908cb85.tar.gz
clock-ac7e8b2318a0e118d4cb7ced49d109c40908cb85.tar.bz2
clock-ac7e8b2318a0e118d4cb7ced49d109c40908cb85.zip
fix content-type headers, and store a day's worth of weather data
Diffstat (limited to 'app/httpd.c')
-rw-r--r--app/httpd.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/app/httpd.c b/app/httpd.c
index 3fdea93..b3776c3 100644
--- a/app/httpd.c
+++ b/app/httpd.c
@@ -257,19 +257,24 @@ static const char *cgi_set_handler (int idx, int num_params, char *params[], cha
int fs_open_custom (struct fs_file *file, const char *name)
{
- int len;
- if (!strcmp (name, "/index.html"))
- len = make_index();
- else if (!strcmp (name, "/alarm.html"))
- len = make_alarm();
+ if (!strcmp (name, "/index.html")) {
+ file->data = (const char *)html_buf;
+ file->len = make_index();
+ }
+ else if (!strcmp (name, "/alarm.html")) {
+ file->data = (const char *)html_buf;
+ file->len = make_alarm();
+ }
+ else if (!strcmp (name, "/meteotime.dat")) {
+ file->data = (const char *)meteotime_data;
+ file->len=sizeof(meteotime_data);
+ }
else {
printf ("looking for url=%s, found nothing\n", name);
return 0;
}
- file->data = (const char *)html_buf;
- file->len = len;
file->index = file->len;
file->pextension = NULL;
file->flags = 0;