diff webserver.rhope @ 165:47ab97730865

Fix a couple of issues in networking lib
author Mike Pavone <pavone@retrodev.com>
date Thu, 10 Mar 2011 04:15:37 +0000
parents 804e48af1027
children
line wrap: on
line diff
--- a/webserver.rhope	Fri Jan 07 03:19:26 2011 -0500
+++ b/webserver.rhope	Thu Mar 10 04:15:37 2011 +0000
@@ -164,8 +164,13 @@
 
 Connection Start[con,address,handlers]
 {
+	Print["Connection Start"]
 	,client <- [con]Read Delim[["\r\n"]Buffer >>]
-	{ request <- String[~] }
+	{ request <- String[~] } {}
+	{ 
+		Print["Error reading request line"] 
+		Close[con]
+	}
 	parts <- [request]Split[" "]
 	Print[[[request]Append[" "]]Append[address]]
 	[client]Read Delim[["\r\n\r\n"]Buffer >>]
@@ -173,6 +178,8 @@
 		headers <- Map[Dict Split[String[~], ":", "\r\n"], Trim[?, " \t"]]
 	}{
 		Handle Request[~, [parts]Index[0], [parts]Index[1], headers, handlers]
+	}{
+		Print["Error reading headers"]
 	}
 }