summaryrefslogtreecommitdiff
path: root/server/src/server.cc
diff options
context:
space:
mode:
authordeva <deva>2007-08-27 12:46:24 +0000
committerdeva <deva>2007-08-27 12:46:24 +0000
commitf872f4327b9900ede2d9b4ee7a3023a6c860d498 (patch)
tree0808d99792c2deb22d4f65ccfee0e6bc43e37ac0 /server/src/server.cc
parent31aea852238dc58182188616c53df8510f4cab4d (diff)
Do something 'reasonable' if the request does not exist.
Diffstat (limited to 'server/src/server.cc')
-rw-r--r--server/src/server.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index 9d52369..6783492 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -95,6 +95,8 @@ static void connection(Pentominos::TCPSocket &socket)
std::string macro = std::string(XML) + "/" + macro_request + ".xml";
int fd = open(macro.c_str(), O_RDONLY);
+ if(fd == -1) return;
+
while((bytes = read(fd, outbuf, sizeof(outbuf))) ) {
socket.write(outbuf, bytes);
}