Older clients have a tendency to send latin-1 on the wire, and the zephyr protocol itself does not require an explicit encoding. Therefore, make encoding and decoding the responsibility of the application using PyZephyr. (PyZephyr will to continue to encode a unicode string to UTF-8 before sending it if that is handed in) Reported-by: Arun A. Tharuvai <firstname.lastname@example.org>
Reported-by: Arun A. Tharuvai <email@example.com>
If code other than receive() ends up calling ZWaitForNotice or similar routines, then there may be zephyrs in the internal Zephyr queue, but no data available on the Zephyr FD. Therefore, before we assume we need to block to receive notices, we need to check ZPending() and process any queued notices.
The one in ZReceiveNotice times out eventually.
Signed-off-by: Anders Kaseorg <firstname.lastname@example.org>
Instead of using a function to convert between struct timeval and a Python float, inline the necessary code in the ZUid and ZNotice conversions. On 64-bit Debian systems, this would result in a struct _ZTimeval being cast to a struct timeval, which just didn't work like you would hope.
They use timeval instead. And Debian-based systems will work if you use timeval instead of _ZTimeval, they'll just whine at you