Mercurial > repos > rhope
diff webserver.rhope @ 147:f3686f60985d
Sort of working port of framework. Transaction bug seems to be getting in the way. Going to work around, but want the old version in the repo so I can test later.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 22 Nov 2010 01:15:02 -0500 |
parents | 1f39e69446f9 |
children | f582fd6c75ee |
line wrap: on
line diff
--- a/webserver.rhope Sun Nov 21 22:47:14 2010 -0500 +++ b/webserver.rhope Mon Nov 22 01:15:02 2010 -0500 @@ -95,7 +95,7 @@ string <- "<html><head><title>Document Not Found</title></head><body>The document you requested is not available on this server.</body></html>" HTTP Response[client, Get Content Type[".html"], [string]Length, Dictionary[], "404 Not Found"] { - [string]Write to File[~] + [[string]Write to File[~]]Close } } @@ -134,8 +134,9 @@ If[[content length] > [0]] { data <- [file]Read[content length] - [HTTP OK[client, Get Content Type[path], content length, Dictionary[]] + [[HTTP OK[client, Get Content Type[path], content length, Dictionary[]] ]Write[data] + ]Close { Close[file] } }{ HTTP Not Found[client] @@ -161,6 +162,7 @@ Connection Start[con,address,handlers] { + Print["New connection!"] ,client <- [con]Read Delim[["\r\n"]Buffer >>] { request <- String[~] } parts <- [request]Split[" "]