summaryrefslogtreecommitdiff
path: root/server/src/server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/server.cc')
-rw-r--r--server/src/server.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index 1786f34..2f89c73 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -110,7 +110,6 @@ static void connection(TCPSocket &socket)
std::vector< Macro >::iterator mi = templ->course.macroes.begin();
while(mi != templ->course.macroes.end()) {
- printf("!!\n"); fflush(stdout);
Macro &macro = (*mi);
if(macro.attributes["name"] == request.macro) {
std::vector< Query >::iterator qi = macro.queries.begin();
@@ -123,6 +122,8 @@ static void connection(TCPSocket &socket)
}
std::string result = qh.exec();
+ printf("Got result: [%s]\n", result.c_str());
+
// Parse the result from the queries to pentominos
QueryParser qp(result);
qp.parse();
@@ -134,6 +135,7 @@ static void connection(TCPSocket &socket)
std::vector< Macro >::iterator mi2 = templ->course.macroes.begin();
while(mi2 != templ->course.macroes.end()) {
Macro &macro = (*mi2);
+ printf("Macro: %s ?= %s\n", macro.attributes["name"].c_str(), request.macro.c_str());
if(macro.attributes["name"] == request.macro) {
widgetgenerator(socket, macro, lqm);
}
@@ -158,7 +160,7 @@ void server()
return;
}
- TCPSocket *socket;
+ TCPSocket *socket = NULL;
try {
socket = new TCPSocket();
@@ -167,6 +169,7 @@ void server()
fprintf(stderr, "Error during parsing:\n%s\n",
e.what());
delete socket;
+ socket = NULL;
return;
}
@@ -192,9 +195,9 @@ void server()
TCPSocket child = socket->accept();
if(child.connected()) {
- socket->disconnect();
- connection(child);
- delete socket;
+ //socket->disconnect();
+ connection(child);
+ //delete socket;
/*
switch(fork()) {