[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2015-02-14 Thread Martin Panter

Martin Panter added the comment:

Opened Issue 23377 about losing the buffer at the end of a response

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2015-01-24 Thread Martin Panter

Martin Panter added the comment:

See Issue 3566 about tweaking the “http.client” module’s BadStatusLine handling 
to be more helpful when implementing persistent connections. I am dumping some 
thoughts here about persistent connections with the “http.client” module, 
gained by working on that bug.

* Lib/xmlrpc/client.py appears to have persistent connection support, so may be 
useful for this bug.

* RFC 7230 §6.5  mentions 
monitoring for connection closure. This could be be partly implemented inside 
HTTPConnection by polling for closure before sending a request, but to fully 
implement might require the co-operation of the user calling into the module to 
check for closure at other times using select() or similar.

* Current “http.client” assumes that each socket.makefile() object will not 
buffer any data from a subsequent response. Unsure if this is a problem in the 
real world, but I ran into it implementing test cases. E.g. if the server 
anticipates the first few bytes of the subsequent response:

c.send(b"HTTP/1.1 200 Okay\r\nContent-Length: 0\r\n\r\n" b"HTTP/")

then the client misses the “HTTP/” and raises BadStatusLine("1.1 200 Okay\r\n").

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2014-06-22 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Mr. Kumar: the "and" is intentional. The server will use keep-alive messages 
only if it operates in HTTP/1.1 mode itself (protocol_version). By default, it 
operates in HTTP/1.0 mode, and does not enable persistent connections there. 
The initial implementation did, but it failed since it often would not send 
content-length headers, which are mandatory for persistent connections.

--
nosy: +loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2014-06-22 Thread V. Kumar

V. Kumar added the comment:

Verified that Persistent Connections per HTTP 1.1 spec is already implemented 
and working correctly.

See:
http://hg.python.org/cpython/file/3f3de8c47ff8/Lib/http/client.py#l432

Also, tested this in packet sniffer to verify that connection is being reused.

But the server.py has in issue where the keep-alive can be used in HTTP/1.0:
http://hg.python.org/cpython/file/7417d8854f93/Lib/http/server.py#l331
So, the and in this line needs to be an 'or'.

--
nosy: +trent, vklogin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2013-10-31 Thread Martin Panter

Martin Panter added the comment:

I wrote a basic “urllib.request” handler class that I have been using for HTTP 
persistent connections. It is called PersistentConnectionHandler; see

https://github.com/vadmium/python-iview/blob/80dc1b4/iview/hds.py#L442

I am happy for this to be used as the basis for a patch for Python, or 
elsewhere.

It manages a single connection. You pass an instance to 
urllib.request.build_opener(), and then it connects to whatever host is 
specified when open() is called. Any old connection is closed when you ask for 
a URL on a new host.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2013-06-17 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2011-03-20 Thread Éric Araujo

Changes by Éric Araujo :


--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2011-03-19 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2010-09-16 Thread ipatrol

ipatrol  added the comment:

Possibly, but I don't really have expertise in the underbelly of the HTTP 
system.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2010-09-02 Thread Éric Araujo

Changes by Éric Araujo :


--
versions:  -Python 2.7, Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2010-09-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Do you think you could provide a patch?

--
nosy: +orsenthil, pitrou
stage:  -> needs patch
versions:  -Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2010-09-02 Thread ipatrol

ipatrol  added the comment:

No, httplib actually creates a second connection with the same object. Neither 
is their support in urllib, urllib2, nor in any of the HTTP servers. This would 
be really useful for a bot connected to an API.

--
resolution: works for me -> 
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2010-09-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

It seems that httplib is exactly what you need:
http://docs.python.org/library/httplib.html#examples

--
nosy: +amaury.forgeotdarc
resolution:  -> works for me
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9740] Support for HTTP 1.1 persistent connections throughout the standard library

2010-09-02 Thread ipatrol

New submission from ipatrol :

HTTP 1.1 introduced persistent connections nearly six years ago. Yet this 
resource saving and speed improving option is not available in the standard 
library. Can this be added?

--
components: Library (Lib)
messages: 115365
nosy: ipatrol
priority: normal
severity: normal
status: open
title: Support for HTTP 1.1 persistent connections throughout the standard 
library
type: feature request
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com