summaryrefslogtreecommitdiff
path: root/server/src/queryhandlerpentominos.cc
diff options
context:
space:
mode:
authordeva <deva>2009-07-29 07:35:47 +0000
committerdeva <deva>2009-07-29 07:35:47 +0000
commitc8e8e01f85d73944f9752bbd3f7746239aec6b9e (patch)
treee080b3899c47f77eeee28670cc045d36e8f3750e /server/src/queryhandlerpentominos.cc
parentab96caac3c631ca452b21a0529372f1165638002 (diff)
Changed Socket * to Socket & in pentominos query.
Diffstat (limited to 'server/src/queryhandlerpentominos.cc')
-rw-r--r--server/src/queryhandlerpentominos.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/server/src/queryhandlerpentominos.cc b/server/src/queryhandlerpentominos.cc
index 9e82241..c52b36c 100644
--- a/server/src/queryhandlerpentominos.cc
+++ b/server/src/queryhandlerpentominos.cc
@@ -135,11 +135,10 @@ static std::string getUID(const char *interface)
}
-QueryHandlerPentominos::QueryHandlerPentominos(TCPSocket *socket, std::string cpr)
- : QueryHandler()
+QueryHandlerPentominos::QueryHandlerPentominos(TCPSocket &_socket, std::string cpr)
+ : QueryHandler(), socket(_socket)
{
this->cpr = cpr;
- this->socket = socket;
}
QueryResult QueryHandlerPentominos::exec(Query &query)
@@ -155,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));
+ socket.write(header, strlen(header));
#endif/*WITHOUT_PENTOMINOS*/
PRACRO_DEBUG(queryhandler, header);
@@ -170,8 +169,8 @@ QueryResult QueryHandlerPentominos::exec(Query &query)
cpr.c_str(),
"pracro",
#ifndef WITHOUT_PENTOMINOS
- socket->srcaddr().c_str(),
- socket->dstaddr().c_str(),
+ socket.srcaddr().c_str(),
+ socket.dstaddr().c_str(),
#else
"127.0.0.1",
"127.0.0.1",
@@ -179,7 +178,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query)
(unsigned int)timestamp,
uid.c_str());
#ifndef WITHOUT_PENTOMINOS
- socket->write(buf, strlen(buf));
+ socket.write(buf, strlen(buf));
#endif/*WITHOUT_PENTOMINOS*/
PRACRO_DEBUG(queryhandler, buf);
@@ -192,7 +191,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query)
query.attributes["class"].c_str());
#ifndef WITHOUT_PENTOMINOS
- socket->write(buf, strlen(buf));
+ socket.write(buf, strlen(buf));
#endif/*WITHOUT_PENTOMINOS*/
PRACRO_DEBUG(queryhandler, buf);
@@ -200,7 +199,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query)
sprintf(buf, "</artefact>");
#ifndef WITHOUT_PENTOMINOS
- socket->write(buf, strlen(buf));
+ socket.write(buf, strlen(buf));
#endif/*WITHOUT_PENTOMINOS*/
PRACRO_DEBUG(queryhandler, buf);
@@ -213,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 = socket.read(buf, sizeof(buf))) > 0) {
// fwrite(buf, size, 1, stdout); fflush(stdout);
if(parser.parse(buf, size)) break;
}
@@ -246,7 +245,7 @@ int main()
return 1;
}
- QueryHandlerPentominos qh(&s, "2003791613");
+ QueryHandlerPentominos qh(s, "2003791613");
Query q1;
q1.attributes["device_id"] = "lensmeter";