[Twisted-Python] Problem in twisted.internet.tcp when using ssl
Martin Sjögren
martin at strakt.com
Fri Jul 19 03:21:14 MDT 2002
ons 2002-07-10 klockan 17.04 skrev Itamar Shtull-Trauring:
> Martin Sjögren wrote:
>
> > The writeSomeData method of Connection objects may sometimes be called
> > with a zero length buffer. This works fine when using plain TCP, but
> > when using ssl, this will cause a ZeroReturnError (which is completely
> > bogus!) and everything...well...blows up.
>
> In the interest of not breaking anything which might possibly, however
> unlikely, depend on tcp.py's behaviour, I've made this change in ssl.py.
> So cvs up and tell me if it's ok now.
I've looked into this a bit more, and found the following in the man
page for write(2) on Solaris.
"""
If nbyte is 0, write() will return 0 and have no other
results if the file is a regular file; otherwise, the
results are unspecified.
"""
My guess is that you would never want to call write or send with a
zero-length string if you want to be portable.
Regards,
Martin
--
Martin Sjögren
martin at strakt.com ICQ : 41245059
Phone: +46 (0)31 7710870 Cell: +46 (0)739 169191
GPG key: http://www.strakt.com/~martin/gpg.html
More information about the Twisted-Python
mailing list