From dfc4b2b9a253d4dbee8684908042090588c8a5eb Mon Sep 17 00:00:00 2001 From: tgoff0 Date: Wed, 21 Jan 2015 21:37:48 +0000 Subject: [PATCH] daemon: Trivial debug message cleanup. Check that a message header was received before trying to log it. --- daemon/sbin/core-daemon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/sbin/core-daemon b/daemon/sbin/core-daemon index 258d51f7..733f619c 100755 --- a/daemon/sbin/core-daemon +++ b/daemon/sbin/core-daemon @@ -203,7 +203,7 @@ class CoreRequestHandler(SocketServer.BaseRequestHandler): ''' try: msghdr = self.request.recv(coreapi.CoreMessage.hdrsiz) - if self.debug: + if self.debug and len(msghdr) > 0: self.info("received message header:\n%s" % hexdump(msghdr)) except Exception, e: raise IOError, "error receiving header (%s)" % e