[omniORB] Fwd: Fix parameter parsing for omniOBpy setClientCallTimeout, setClientThreadCallTimeout, setClientConnectTimeout

Glen Walker glen at walker.gen.nz
Fri Feb 16 12:40:11 UTC 2024


Hi Duncan,

I recently came across this issue again, would appreciate it if you would
take a look at the included patch.

Kind regards,
Glen


---------- Forwarded message ---------
From: Glen Walker <glen at walker.gen.nz>
Date: Wed, 31 Jan 2018 at 13:32
Subject: Fix parameter parsing for omniOBpy setClientCallTimeout,
setClientThreadCallTimeout, setClientConnectTimeout
To: <omniorb-list at omniorb-support.com>


The C++ API for omniORB contains the functions

namespace omniORB {
  void setClientCallTimeout(CORBA::ULong millisecs);
  void setClientCallTimeout(CORBA::Object_ptr obj, CORBA::ULong millisecs);
  void setClientThreadCallTimeout(CORBA::ULong millisecs);
  void setClientConnectTimeout(CORBA::ULong millisecs);
};

and the Python API for omniORB contains the corresponding functions

omniORB.setClientCallTimeout(millisecs)
omniORB.setClientCallTimeout(objref, millisecs)
omniORB.setClientThreadCallTimeout(millisecs)
omniORB.setClientConnectTimeout(millisecs)

however omniORBpy is parsing the millisecs parameter as a signed integer
instead of an unsigned long. This leads to incorrect timeouts if values
over 2^31 - 1 are used. Admittedly this is only a problem for timeouts of
over 24.9 days, which should be uncommon, and we only noticed the issue
when debugging a problem where we had multipled a timeout in seconds by
1000 more that once.

Attached is a patch to fix the issue. Note that it uses "k" to parse the
unsigned long, which was introduced in Python 2.3, and will be a problem if
omniORBpy still supports earlier versions.

Cheers,
Glen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.omniorb-support.com/pipermail/omniorb-list/attachments/20240216/25821dca/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyomniFunc.cc.patch
Type: application/x-patch
Size: 1463 bytes
Desc: not available
URL: <https://www.omniorb-support.com/pipermail/omniorb-list/attachments/20240216/25821dca/attachment.bin>


More information about the omniORB-list mailing list