Open Lameorc opened 5 years ago
Hi,
looking at the problem, there is a default protocol version 1.0 set after each call if there is no protocolVersion
in the response from server (see src/frpchttpclient.cc:235, the default version is set in src/frpcxmlunarshaller.cc:290).
This limits the usage serverproxy for second and consecutive calls because the default version (FRPC_MAJOR_VERSION_DEFAULT
, FRPC_MINOR_VERSION_DEFAULT
set in ProtocolVersion_t
ctor) is overwritten with 1.0 default.
I'd propose a fix that would set protocolVersion to the pair FRPC_MAJOR_VERSION_DEFAULT
, FRPC_MINOR_VERSION_DEFAULT
if there is no protocolVersion
field in the XML response.
If I'm understanding your proposed solution correctly, it would cause the protocol version set in ctor to be kept for consecutive requests. This seems like a sensible solution to the problem so I am all for it.
I mean if we can't get any protocol version from the server response, it's the only reasonable course of action, since we already did a call to the server before validating the protocol version anyway.
Commenting out the else branch in frpcxmlunarshaller.cc should also work.
Hi. I've recently encountered an issue where a second call with number that's serialized into
<i8>
on ServerProxy object fails with error:Provided are server and client scripts used to simulate this behavior, run using python2:
Seems to me like fastrpc does not only fallback from using binary when communicating with xmlrpc server but also to a lower protocol version. This is backed up by the fact that making only the call with a large number does not fail, eg. this script runs fine:
Versions as reported by dpkg: