summaryrefslogtreecommitdiff
path: root/lib/HttpServ.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/HttpServ.cc')
-rw-r--r--lib/HttpServ.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc
index 97152a9..b354f69 100644
--- a/lib/HttpServ.cc
+++ b/lib/HttpServ.cc
@@ -1,6 +1,7 @@
+#include "Socket.h"
#include "Action.h"
#include "HttpServ.h"
-#include "Socket.h"
+#include "Buffer.h"
#include "config.h"
String endhl = "\r\n", endnl = "\n";
@@ -13,12 +14,11 @@ HttpServ::HttpServ(int port, const String & nname) : name(nname), localport(port
void HttpServ::MainLoop(Action * p) {
while (1) {
- ProcessRequest(p);
+ ProcessRequest(p, Socket(Listener.Accept()));
}
}
-void HttpServ::ProcessRequest(Action * p) {
- Socket s(Listener.Accept());
+void HttpServ::ProcessRequest(Action * p, Socket s) {
String file, domain, t;
Action * f;
int len;
@@ -31,7 +31,6 @@ void HttpServ::ProcessRequest(Action * p) {
bool post = ParseUri(file, domain, s);
-
len = -1;
do {
s >> t;