[Patches] [ python-Patches-945642 ] nonblocking i/o with ssl socket not working at all

SourceForge.net noreply at sourceforge.net
Sat May 1 22:46:19 EDT 2004


Patches item #945642, was opened at 2004-04-30 15:14
Message generated for change (Comment added) made by jesperjurcenoks
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=945642&group_id=5470

Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 7
Submitted By: Tino Lange (tinolange)
Assigned to: Nobody/Anonymous (nobody)
Summary: nonblocking i/o with ssl socket not working at all

Initial Comment:
Hi!

Unfortunately the applied patches #675750 and #676472
(End of January by G. Talvola / B. Laurie / G. v.
Rossum) for timeout-sockets in version 1.09 and 1.10 to
Modules/_ssl.c broke the nonblocking SSL I/O.

In fact sslobj.read() became *always* blocking -
whether the underlying socket is blocking or
nonblocking doesn't matter at all.

In Python < 2.3 this has worked correctly, starting
with 2.3, 2.3.x up to the current CVS it doesn't work
anymore.

Attached is a sample:

0) [ Preparation ]
Please run stunnel on your machine to have a SSL service:
/usr/sbin/stunnel -p /path/to/some/cert -f -d 4711 -r 4712

1) [ Server ]
Please run the easy server.py 

2) [Client showing the bug]
Please run the client - and see how it hangs when you
use Python2.3.

Also attached is a diff against the current _ssl.c
which shows how to correct that behaviour while also
having the possibilities from the above timeout patches.

I carefully tested it,  please review and test yourself
and finally check-in.

If you have questions, please don't hesitate to ask me.

I really would like to see that not only in 2.4, but
also (if possible together with patch #909007 from S.
Nicolary) in a 2.3.4 release. Otherwise 2.3.x wasn't at
all able to handle nonblocking SSL connections properly.

Thanks and cheers,

Tino

----------------------------------------------------------------------

Comment By: Jesper ´JJ´ Jurcenoks (jesperjurcenoks)
Date: 2004-05-01 19:46

Message:
Logged In: YES 
user_id=1033524

Hi Tino.

I just submitted a nonblocking SocketServer.py, it might just 
solve your problem.

JJ

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=945642&group_id=5470



More information about the Patches mailing list