+ + + + + Shrine +
+Connected and easy to use.
++
diff --git a/Build/ShrineDistro.HC b/Build/ShrineDistro.HC index 93e63ad..5f9f939 100644 --- a/Build/ShrineDistro.HC +++ b/Build/ShrineDistro.HC @@ -141,6 +141,7 @@ U0 StdDistroPrep() CopyTree("C:/Kernel",TOS_DISTRO_DIR "/Kernel"); CopyTree("C:/Misc",TOS_DISTRO_DIR "/Misc"); // CopyTree("C:/User",TOS_DISTRO_DIR "/User"); + CopyTree("C:/Www",TOS_DISTRO_DIR "/Www"); Copy("C:/HomeKeyPlugIns.HC", TOS_DISTRO_DIR "/"); Copy("C:/HomeLocalize.HC", TOS_DISTRO_DIR "/"); Copy("C:/HomeSys.HC", TOS_DISTRO_DIR "/"); diff --git a/CHANGELOG.md b/CHANGELOG.md index 262fd3e..0e8385e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,4 +18,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - TCP server mode is now usable (`close` doesn't abruptly terminate the connection) -[Unreleased]: https://github.com/Shrine/compare/9317cf4f645a0072d5fa3f9abc466964d8baad4c...v5 +[Unreleased]: https://github.com/minexew/Shrine/compare/9317cf4f645a0072d5fa3f9abc466964d8baad4c...v5 diff --git a/Demo/Network/HtServ.HC b/Demo/Network/HtServ.HC index 375b71c..71f2f4f 100644 --- a/Demo/Network/HtServ.HC +++ b/Demo/Network/HtServ.HC @@ -40,6 +40,9 @@ U0 HtServProcess(CHtServSession* sess) { if (SERVER_STRING) { sendString(sess->sock, SERVER_STRING, 0); } + + // TODO: how about some Content-Type?? + sendString(sess->sock, "\r\n", 0); sendall(sess->sock, data, size, 0); sess->state = STATE_TERM; @@ -108,8 +111,15 @@ U0 HtServSession(CTcpSocket* sock) { } sess.protocol = StrNew(protocol); - // TODO: should urldecode - sess.resource = StrNew(resource); + + // FIXME: should urldecode resource + // FIXME: must check for trailing slash in general + if (!StrCmp(resource, "/")) { + sess.resource = StrNew("/Index.HTM"); + } + else { + sess.resource = StrNew(resource); + } sess.state = STATE_HEADERS; } diff --git a/Www/Index.HTM b/Www/Index.HTM new file mode 100644 index 0000000..7cd58fe --- /dev/null +++ b/Www/Index.HTM @@ -0,0 +1,73 @@ + + +
+