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.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index f6c811b..288dbe1 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -79,19 +79,15 @@ static void connection(TCPSocket &socket)
Transaction transaction;
parse(socket, transaction);
- std::string xml_version = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- socket.write((char*)xml_version.c_str(), xml_version.length());
-
- std::string header = "<pracro version=\"1.0\">\n";
- socket.write((char*)header.c_str(), header.length());
+ socket.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+ socket.write("<pracro version=\"1.0\">\n");
// Handle requests
Requests::iterator i = transaction.requests.begin();
while(i != transaction.requests.end()) {
Request request = *i;
- printf("Request [%s]...\n", request.macro.c_str());
-
+ printf("Handling request for \"%s\"...", request.macro.c_str());
// Now handle the request.
char outbuf[3];
@@ -109,6 +105,8 @@ static void connection(TCPSocket &socket)
socket.write(outbuf, bytes);
}
close(fd);
+
+ printf("done.\n");
i++;
}
@@ -120,10 +118,9 @@ static void connection(TCPSocket &socket)
j++;
}
- std::string footer = "</pracro>\n";
- socket.write((char*)footer.c_str(), footer.length());
+ socket.write("</pracro>\n");
- printf("done\n");
+ printf("Done with connection.\n");
}
void server()