From 0e819eb42b4d680a99ae7b04702bfc9510495aee Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 6 Jan 2010 07:47:58 +0000 Subject: New artefact connection class (to later wrap libartefact). New environment class to hold all global resources. Made ConnectionPool a template class. Split journal code up into two files (class from commit code). --- server/src/queryhandlerpentominos.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'server/src/queryhandlerpentominos.cc') diff --git a/server/src/queryhandlerpentominos.cc b/server/src/queryhandlerpentominos.cc index 62a742f..4abf5da 100644 --- a/server/src/queryhandlerpentominos.cc +++ b/server/src/queryhandlerpentominos.cc @@ -135,8 +135,8 @@ static std::string getUID(const char *interface) } -QueryHandlerPentominos::QueryHandlerPentominos(TCPSocket &_socket, std::string cpr) - : QueryHandler(), socket(_socket) +QueryHandlerPentominos::QueryHandlerPentominos(Artefact &atf, std::string cpr) + : QueryHandler(), artefact(atf) { this->cpr = cpr; } @@ -154,7 +154,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query) " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" " xsi:schemaLocation=\"http://www.aasimon.org/pentominos schema.xsd\">\n"; #ifndef WITHOUT_PENTOMINOS - socket.write(header, strlen(header)); + artefact.socket.write(header, strlen(header)); #endif/*WITHOUT_PENTOMINOS*/ PRACRO_DEBUG(queryhandler, "%s", header); @@ -169,8 +169,8 @@ QueryResult QueryHandlerPentominos::exec(Query &query) cpr.c_str(), "pracro", #ifndef WITHOUT_PENTOMINOS - socket.srcaddr().c_str(), - socket.dstaddr().c_str(), + artefact.socket.srcaddr().c_str(), + artefact.socket.dstaddr().c_str(), #else "127.0.0.1", "127.0.0.1", @@ -178,7 +178,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query) (unsigned int)timestamp, uid.c_str()); #ifndef WITHOUT_PENTOMINOS - socket.write(buf, strlen(buf)); + artefact.socket.write(buf, strlen(buf)); #endif/*WITHOUT_PENTOMINOS*/ PRACRO_DEBUG(queryhandler, "%s", buf); @@ -191,7 +191,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query) query.attributes["class"].c_str()); #ifndef WITHOUT_PENTOMINOS - socket.write(buf, strlen(buf)); + artefact.socket.write(buf, strlen(buf)); #endif/*WITHOUT_PENTOMINOS*/ PRACRO_DEBUG(queryhandler, "%s", buf); @@ -199,7 +199,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query) sprintf(buf, ""); #ifndef WITHOUT_PENTOMINOS - socket.write(buf, strlen(buf)); + artefact.socket.write(buf, strlen(buf)); #endif/*WITHOUT_PENTOMINOS*/ PRACRO_DEBUG(queryhandler, "%s", buf); @@ -212,7 +212,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query) ssize_t size; // Read until we've got the entire result. - while((size = socket.read(buf, sizeof(buf))) > 0) { + while((size = artefact.socket.read(buf, sizeof(buf))) > 0) { // fwrite(buf, size, 1, stdout); fflush(stdout); if(parser.parse(buf, size)) break; } -- cgit v1.2.3