@scrypted/server 0.7.8 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @scrypted/server might be problematic. Click here for more details.
- package/package.json +1 -1
- package/python/plugin_remote.py +6 -3
package/package.json
CHANGED
package/python/plugin_remote.py
CHANGED
@@ -45,7 +45,10 @@ class StreamPipeReader:
|
|
45
45
|
b = bytes(0)
|
46
46
|
while len(b) < n:
|
47
47
|
self.conn.poll()
|
48
|
-
|
48
|
+
add = os.read(self.conn.fileno(), n - len(b))
|
49
|
+
if not len(add):
|
50
|
+
raise Exception('unable to read requested bytes')
|
51
|
+
b += add
|
49
52
|
return b
|
50
53
|
|
51
54
|
async def read(self, n):
|
@@ -482,9 +485,8 @@ class PluginRemote:
|
|
482
485
|
schedule_exit_check()
|
483
486
|
|
484
487
|
async def getFork():
|
485
|
-
fd = os.dup(parent_conn.fileno())
|
486
488
|
reader = StreamPipeReader(parent_conn)
|
487
|
-
forkPeer, readLoop = await rpc_reader.prepare_peer_readloop(self.loop, reader = reader, writeFd =
|
489
|
+
forkPeer, readLoop = await rpc_reader.prepare_peer_readloop(self.loop, reader = reader, writeFd = parent_conn.fileno())
|
488
490
|
forkPeer.peerName = 'thread'
|
489
491
|
async def forkReadLoop():
|
490
492
|
try:
|
@@ -493,6 +495,7 @@ class PluginRemote:
|
|
493
495
|
# traceback.print_exc()
|
494
496
|
print('fork read loop exited')
|
495
497
|
finally:
|
498
|
+
parent_conn.close()
|
496
499
|
reader.executor.shutdown()
|
497
500
|
asyncio.run_coroutine_threadsafe(forkReadLoop(), loop=self.loop)
|
498
501
|
getRemote = await forkPeer.getParam('getRemote')
|