From 33c8e34456ca902fa5087d91c46418315c4c5db4 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 26 Oct 2021 16:40:38 +0200 Subject: [PATCH] use the resume call before pumping data from a reader --- csdr/module/__init__.py | 2 ++ owrx/aprs/module.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/csdr/module/__init__.py b/csdr/module/__init__.py index 8e3c703..64374a6 100644 --- a/csdr/module/__init__.py +++ b/csdr/module/__init__.py @@ -120,6 +120,8 @@ class PopenModule(AutoStartModule, metaclass=ABCMeta): def start(self): self.process = Popen(self.getCommand(), stdin=PIPE, stdout=PIPE) + # resume in case the reader has been stop()ed before + self.reader.resume() Thread(target=self.pump(self.reader.read, self.process.stdin.write)).start() Thread(target=self.pump(partial(self.process.stdout.read, 1024), self.writer.write)).start() diff --git a/owrx/aprs/module.py b/owrx/aprs/module.py index 4154c81..28bb51d 100644 --- a/owrx/aprs/module.py +++ b/owrx/aprs/module.py @@ -49,6 +49,8 @@ class DirewolfModule(AutoStartModule, DirewolfConfigSubscriber): stdin=PIPE, ) + # resume in case the reader has been stop()ed before + self.reader.resume() threading.Thread(target=self.pump(self.reader.read, self.process.stdin.write)).start() delay = 0.5