From 060693625f9693b64c18c15865f3a067c6a7572f Mon Sep 17 00:00:00 2001 From: Jan Klopper Date: Wed, 6 Apr 2016 10:11:05 +0200 Subject: [PATCH] add packet size limit to server,s et at 140 pixels atm --- vloed.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vloed.py b/vloed.py index 4ceddb3..4209857 100755 --- a/vloed.py +++ b/vloed.py @@ -38,6 +38,7 @@ class Canvas(object): self.canvas() self.set_title() self.queue = queue + self.limit = 140 @staticmethod def set_title(text=None): @@ -100,7 +101,8 @@ class Canvas(object): ) pixelcount = (len(data)-1) / pixellength if self.debug: - print '%d pixels received, protocol V %d ' % (pixelcount, protocol) + print '%d pixels received, protocol V %d ' % ( + min(pixelcount, self.limit), protocol) for i in xrange(0, pixelcount): pixel = struct.unpack_from( packetformat,