diff options
author | deva <deva> | 2007-09-03 09:58:51 +0000 |
---|---|---|
committer | deva <deva> | 2007-09-03 09:58:51 +0000 |
commit | 41e5a068b0b595be86797fd12035dabb87c21f36 (patch) | |
tree | 7d9dd21b54d5d8075b220e5aa06526387ca53d20 /server/src/server.cc | |
parent | f49186b63888caedd5e0dad4a52a680fb28834a4 (diff) |
Simplified TCP socket write of strings. Cleaned up debug output.
Diffstat (limited to 'server/src/server.cc')
-rw-r--r-- | server/src/server.cc | 17 |
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() |