summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Beattie <mike@ethernal.org>2012-03-22 18:11:02 +1300
committerMike Beattie <mike@ethernal.org>2012-03-22 18:11:02 +1300
commit697792c698fbbd31965c25d1dc93c6addc74cd2c (patch)
treed80011db8b466dab9f0479f7ee8ed6cc89d2ffe0
parenta854bcbb20f6d576e94bdbe0b47365d36256b708 (diff)
Convert main HTML output to gzip compressed data.
Signed-off-by: Mike Beattie <mike@ethernal.org>
-rw-r--r--HouseControl.ino68
1 files changed, 65 insertions, 3 deletions
diff --git a/HouseControl.ino b/HouseControl.ino
index 766d9b8..6e6ec71 100644
--- a/HouseControl.ino
+++ b/HouseControl.ino
@@ -162,12 +162,72 @@ void parseNTPresponse() {
void httpHandler(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete) {
/* for a GET or HEAD, send the standard "it's all OK headers" */
- server.httpSuccess();
+ server.httpSuccess("text/html; charset=iso-8859-1", "Content-Encoding: gzip\r\n");
/* we don't output the body for a HEAD request */
if (type == WebServer::GET) {
- /* store the HTML in program memory using the P macro */
- P(message) =
+ /* store the HTML in program memory using the P macro - See index.html for content, encode_html.sh for getting this data */
+// /*
+ P(message) = {
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc5, 0x56, 0x5b, 0x8f, 0x9b, 0x38,
+ 0x14, 0x7e, 0xcf, 0xaf, 0xb0, 0xd4, 0x59, 0x99, 0xa8, 0x01, 0x02, 0x53, 0xfa, 0x40, 0x08, 0x2f,
+ 0x53, 0xed, 0x4a, 0xab, 0x55, 0xbb, 0x52, 0x2f, 0xef, 0x06, 0x1b, 0xf0, 0x04, 0x6c, 0x6a, 0x9b,
+ 0xcc, 0x44, 0xd1, 0xfc, 0xf7, 0x3d, 0x36, 0x24, 0x43, 0x67, 0x32, 0xea, 0x54, 0xfb, 0x50, 0x25,
+ 0x0a, 0xe6, 0x3b, 0xdf, 0xb9, 0xfa, 0x9c, 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, 0x34, 0xcf, 0xd2, 0x05, 0xdd, 0xdf, 0x92, 0xaf, 0x1d, 0xd6, 0x53, 0xc2,
+ 0x7f, 0xb9, 0x89, 0x72, 0x19, 0xa3, 0xe8, 0xd5, 0x39, 0xc7, 0xff, 0x23, 0xe7, 0xf8, 0x37, 0xe5,
+ 0x1c, 0x5f, 0xcc, 0x39, 0x7e, 0x21, 0xe7, 0xf0, 0x34, 0x0a, 0x4e, 0x04, 0x8f, 0x69, 0xe4, 0x42,
+ 0xf7, 0x47, 0x64, 0xf1, 0x1f, 0x55, 0xc9, 0x65, 0xbc, 0x90, 0x08, 0x00, 0x00,
+ };
+
+ server.writeP(message, sizeof(message));
+// */
+ /*
+ P(message) =
"<html><head><title>Door Control</title>"
"<meta id='viewport' name='viewport' content='width=160; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;'>"
"<style>"
@@ -236,7 +296,9 @@ void httpHandler(WebServer &server, WebServer::ConnectionType type, char *url_ta
"</body>"
"</html>";
+
server.printP(message);
+ */
}
}