A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2003-January/032417.html below:

[Python-Dev] the new 2.3a1 settimeout() with httplib and SSL

[Python-Dev] the new 2.3a1 settimeout() with httplib and SSLGeoffrey Talvola gtalvola@nameconnector.com
Fri, 24 Jan 2003 18:37:38 -0500
I'm trying to get the new socket.settimeout() in Python 2.3a1 to work in
conjunction with httplib and SSL.  This code seems to work fine:

	import httplib
	conn = httplib.HTTPConnection('ncsdevtest.nameconnector.com', 80)
	conn.connect()
	conn.sock.settimeout(90)
	conn.request('GET', '/cgi-bin/Pause30.cgi')
	response = conn.getresponse()
	print response.status, response.reason
	data = response.read()
	print 'read', len(data), 'bytes'
	conn.close()

Where Pause30.cgi is a cgi script that simply sleeps for 30 seconds then
sends back a simple response.

As-is, this program returns after 30 seconds.  If I adjust the timeout of 90
to be, lets say, 5 seconds, I correctly get a timeout exception after 5
seconds.  So far, so good.

But if I change HTTPConnection to HTTPSConnection and change 80 to 443, I
have trouble -- my CPU usage goes up to 100%, the python process sucks up
more and more memory, and it doesn't time out at all.  It does still returns
the correct response after 30 seconds.

Is there a way to do this?  Should I enter a bug report?

- Geoff



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4