diff options
author | deva <deva> | 2008-05-20 14:03:10 +0000 |
---|---|---|
committer | deva <deva> | 2008-05-20 14:03:10 +0000 |
commit | 556f00e4af55e78836c45f47b0662ab44bbb8b48 (patch) | |
tree | a5c315b35d400a397a35a86b86fe656d3a829af9 /server/src/server.cc | |
parent | 91d56787bec83a3a7c2ad6afd84d2b82c5d869b9 (diff) |
Made fixes pointed out by GCC 4.2 and -D_FORTIFY_SOURCES=2
Diffstat (limited to 'server/src/server.cc')
-rw-r--r-- | server/src/server.cc | 13 |
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 ¯o = (*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 ¯o = (*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()) { |