summaryrefslogtreecommitdiff
path: root/httpd
diff options
context:
space:
mode:
authorJeff Armstrong <jeffrey.armstrong@approximatrix.com>2017-02-11 12:45:49 -0500
committerJeff Armstrong <jeffrey.armstrong@approximatrix.com>2017-02-11 12:45:49 -0500
commit292d276205c04d3ff944f56e27db18852b3a9e62 (patch)
treea5e8d022a024b9834504e4a7bca2d92b72fa26d9 /httpd
parent621c26567548e514fc793d35b208a3542b73f023 (diff)
downloaduIP-FOSSIL-292d276205c04d3ff944f56e27db18852b3a9e62.tar.gz
uIP-FOSSIL-292d276205c04d3ff944f56e27db18852b3a9e62.zip
Added support for RSS feeds (via an RSS file).
Diffstat (limited to 'httpd')
-rw-r--r--httpd/http-str.c9
-rw-r--r--httpd/http-str.h4
-rw-r--r--httpd/httpd.c3
3 files changed, 16 insertions, 0 deletions
diff --git a/httpd/http-str.c b/httpd/http-str.c
index 6b86ca6..71f2601 100644
--- a/httpd/http-str.c
+++ b/httpd/http-str.c
@@ -74,6 +74,9 @@ const char http_content_type_jpg [29] =
const char http_content_type_binary[43] =
/* "Content-type: application/octet-stream\r\n\r\n" */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xd, 0xa, 0xd, 0xa, };
+const char http_content_type_rss [38] =
+/* "Content-type: applicaion/rss+xml\r\n\r\n" */
+{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x72, 0x73, 0x73, 0x2b, 0x78, 0x6d, 0x6c, 0xd, 0xa, 0xd, 0xa, };
const char http_html[6] =
/* ".html" */
{0x2e, 0x68, 0x74, 0x6d, 0x6c, };
@@ -107,6 +110,12 @@ const char http_text[5] =
const char http_txt[5] =
/* ".txt" */
{0x2e, 0x74, 0x78, 0x74, };
+const char http_rss[5] =
+/* ".rss" */
+{0x2e, 0x72, 0x73, 0x73, };
+const char http_rgz[5] =
+/* ".rgz" */
+{0x2e, 0x72, 0x67, 0x7a, };
const char http_gzip[4] =
/* "gzip" */
{0x67, 0x7a, 0x69, 0x70};
diff --git a/httpd/http-str.h b/httpd/http-str.h
index 712df71..e98ad8d 100644
--- a/httpd/http-str.h
+++ b/httpd/http-str.h
@@ -1,3 +1,4 @@
+
extern const char http_http[8];
extern const char http_200[5];
extern const char http_301[5];
@@ -23,6 +24,7 @@ extern const char http_content_type_png [28];
extern const char http_content_type_gif [28];
extern const char http_content_type_jpg [29];
extern const char http_content_type_binary[43];
+extern const char http_content_type_rss[38];
extern const char http_html[6];
extern const char http_htm[5];
extern const char http_shtml[7];
@@ -35,6 +37,8 @@ extern const char http_gif[5];
extern const char http_jpg[5];
extern const char http_text[5];
extern const char http_txt[5];
+extern const char http_rss[5];
+extern const char http_rgz[5];
extern const char http_gzip[4];
extern const char http_accept_encode[17];
extern const char http_content_encode[24];
diff --git a/httpd/httpd.c b/httpd/httpd.c
index 459bfa2..d4cbbd6 100644
--- a/httpd/httpd.c
+++ b/httpd/httpd.c
@@ -119,6 +119,9 @@ static PT_THREAD(send_headers(struct httpd_state *s, const char *statushdr))
PSOCK_SEND_STR(&s->sout, http_content_type_gif);
} else if(strncmp(http_jpg, ptr, 4) == 0) {
PSOCK_SEND_STR(&s->sout, http_content_type_jpg);
+ } else if(strncmp(http_rss, ptr, 4) == 0 ||
+ strncmp(http_rgz, ptr, 4) == 0) {
+ PSOCK_SEND_STR(&s->sout, http_content_type_rss);
} else {
PSOCK_SEND_STR(&s->sout, http_content_type_plain);
}