New submission from STINNER Victor <victor.stin...@haypocalc.com>:

Since Python 2.7 / 3.2, httplib supports HTTP(S)/1.1 (keep-alive). This version 
of HTTP is much faster because the connection is kept between two requests. I'm 
using it with XML-RPC + SSL (M2Crypto). It works nice.

My problem is when the server closes the connection (eg. the server restarts). 
If I send a small (XML-RPC) request, sending the request works (I don't 
understand why, maybe because of a buffer somewhere), but getting the response 
raises a BadStatusLine because the response is empty (0 byte). If I send a big 
(XML-RPC) request, sending the request fails with a SSLError(EPIPE, '...') and 
Transport.request() doesn't retry with a new connection.

I patched my copy of M2Crypto to ensure that SSLError inherits from 
socket.error, but it's not enough: Transport.request() only catchs 
errno.ECONNRESET and errno.ECONNABORTED socket errors.

Attached patch catchs also errno.EPIPE. This error is received on sending to 
the socket whereas the server closed the socket.

----------
components: Library (Lib)
files: xmlrpc_request_epipe.patch
keywords: patch
messages: 108146
nosy: haypo
priority: normal
severity: normal
status: open
title: xmlrpc: Transport.request() should also catch socket.error(EPIPE)
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file17715/xmlrpc_request_epipe.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9032>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to