beremiz

Fix Pyro work with SSL wrapper (sslpsk)

2019-03-13, Andrey Skvortsov
2befed4d6ca8
Fix Pyro work with SSL wrapper (sslpsk)

Following error was shown in Beremiz console:
PYRO connecting to URI : PYROS://127.0.0.1:3001#beremiz
Exception while connecting to 'PYROS://127.0.0.1:3001#beremiz': non-zero flags not allowed in calls to recv() on
Connection failed to PYROS://127.0.0.1:3001#beremiz!

Reason is that Pyro calls socket recv() with MSGWAITALL flag, that causes ValueError exception.

https://docs.python.org/2/library/ssl.html
recv(), recv_into() (but passing a non-zero flags argument is not allowed)
<?xml version="1.0"?>
<!DOCTYPE PyObject SYSTEM "PyObjects.dtd">
<PyObject module="node" class="Node" id="173548044">
<attr name="Profile" type="dict" id="173547276" >
</attr>
<attr name="Description" type="string" value="" />
<attr name="Dictionary" type="dict" id="173547004" >
<entry>
<key type="numeric" value="4096" />
<val type="numeric" value="0" />
</entry>
<entry>
<key type="numeric" value="4097" />
<val type="numeric" value="0" />
</entry>
<entry>
<key type="numeric" value="4120" />
<val type="list" id="172243596" >
<item type="numeric" value="0" />
<item type="numeric" value="0" />
<item type="numeric" value="0" />
<item type="numeric" value="0" />
</val>
</entry>
</attr>
<attr name="SpecificMenu" type="list" id="172243852" >
</attr>
<attr name="ParamsDictionary" type="dict" id="173551796" >
</attr>
<attr name="UserMapping" type="dict" id="173551932" >
</attr>
<attr name="DS302" type="dict" id="172206524" >
<entry>
<key type="numeric" value="7968" />
<val type="dict" id="172959508" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
<val type="list" id="172244812" >
<item type="dict" id="173546596" >
<entry>
<key type="string" value="access" />
<val type="string" value="ro" />
</entry>
<entry>
<key type="string" value="pdo" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="type" />
<val type="numeric" value="5" />
</entry>
<entry>
<key type="string" value="name" />
<val type="string" value="Number of Entries" />
</entry>
</item>
<item type="dict" id="173552204" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
</entry>
<entry>
<key type="string" value="pdo" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="type" />
<val type="numeric" value="15" />
</entry>
<entry>
<key type="string" value="name" />
<val type="string" value="Store DCF for node %d[(sub)]" />
</entry>
<entry>
<key type="string" value="nbmax" />
<val type="numeric" value="127" />
</entry>
</item>
</val>
</entry>
<entry>
<key type="string" value="name" />
<val type="string" value="Store DCF" />
</entry>
<entry>
<key type="string" value="struct" />
<val type="numeric" value="7" />
</entry>
</val>
</entry>
<entry>
<key type="numeric" value="7969" />
<val type="dict" id="173546732" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
<val type="list" id="172253420" >
<item type="dict" id="173552612" >
<entry>
<key type="string" value="access" />
<val type="string" value="ro" />
</entry>
<entry>
<key type="string" value="pdo" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="type" />
<val type="numeric" value="5" />
</entry>
<entry>
<key type="string" value="name" />
<val type="string" value="Number of Entries" />
</entry>
</item>
<item type="dict" id="173546324" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
</entry>
<entry>
<key type="string" value="pdo" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="type" />
<val type="numeric" value="2" />
</entry>
<entry>
<key type="string" value="name" />
<val type="string" value="Storage Format for Node %d[(sub)]" />
</entry>
<entry>
<key type="string" value="nbmax" />
<val type="numeric" value="127" />
</entry>
</item>
</val>
</entry>
<entry>
<key type="string" value="name" />
<val type="string" value="Storage Format" />
</entry>
<entry>
<key type="string" value="struct" />
<val type="numeric" value="7" />
</entry>
</val>
</entry>
<entry>
<key type="numeric" value="7970" />
<val type="dict" id="173552476" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
<val type="list" id="172253484" >
<item type="dict" id="173552884" >
<entry>
<key type="string" value="access" />
<val type="string" value="ro" />
</entry>
<entry>
<key type="string" value="pdo" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="type" />
<val type="numeric" value="5" />
</entry>
<entry>
<key type="string" value="name" />
<val type="string" value="Number of Entries" />
</entry>
</item>
<item type="dict" id="173552748" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
</entry>
<entry>
<key type="string" value="pdo" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="type" />
<val type="numeric" value="15" />
</entry>
<entry>
<key type="string" value="name" />
<val type="string" value="Concise DCF for Node %d[(sub)]" />
</entry>
<entry>
<key type="string" value="nbmax" />
<val type="numeric" value="127" />
</entry>
</item>
</val>
</entry>
<entry>
<key type="string" value="name" />
<val type="string" value="Concise DCF" />
</entry>
<entry>
<key type="string" value="struct" />
<val type="numeric" value="7" />
</entry>
</val>
</entry>
</attr>
<attr name="ProfileName" type="string" value="None" />
<attr name="Type" type="string" value="master" />
<attr name="ID" type="numeric" value="0" />
<attr name="Name" type="string" value="MasterNode" />
</PyObject>