From f872f4327b9900ede2d9b4ee7a3023a6c860d498 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 27 Aug 2007 12:46:24 +0000 Subject: Do something 'reasonable' if the request does not exist. --- server/src/server.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'server/src') 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); } -- cgit v1.2.3