mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix Pulsar's default HTTP transport for poster hacking up urllib.
Behavior of urllib changes with respect of content length of mmap content after poster is loaded - is automatically loaded by Pulsar client as of 9207ecb43d81853da7a58cd5634683dc87991c4f (added as part of October 2014 stable release). Enis has confirmed this fixes some problems in latest stable.
This commit is contained in:
@@ -24,11 +24,13 @@ class Urllib2Transport(object):
|
||||
input = None
|
||||
try:
|
||||
if input_path:
|
||||
if getsize(input_path):
|
||||
size = getsize(input_path)
|
||||
if size:
|
||||
input = open(input_path, 'rb')
|
||||
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
|
||||
else:
|
||||
data = b""
|
||||
request.add_header('Content-Length', str(size))
|
||||
response = self._url_open(request, data)
|
||||
finally:
|
||||
if input:
|
||||
|
||||
Reference in New Issue
Block a user