search for: putheader

Displaying 20 results from an estimated 52 matches for "putheader".

Did you mean: preheader
2018 Jun 14
5
[PATCH] v2v: -o rhv-upload: Optimize http request sending
...transfer_service = h['transfer_service'] - http.putrequest("GET", h['path']) + headers = {"Range", "bytes=%d-%d" % (offset, offset+count-1)} # Authorization is only needed for old imageio. if h['needs_auth']: - http.putheader("Authorization", transfer.signed_ticket) - http.putheader("Range", "bytes=%d-%d" % (offset, offset+count-1)) - http.endheaders() + headers["Authorization"] = transfer.signed_ticket + + http.request("GET", h['path'], headers=h...
2018 Jun 29
2
[PATCH] v2v: rhv-upload-plugin: Remove unneeded auth
...only for GET and PUT requests when + # communicating with old imageio-proxy. needs_auth = not params['rhv_direct'] + can_flush = False can_trim = False can_zero = False unix_socket = None - http.putrequest("OPTIONS", destination_url.path) - http.putheader("Authorization", transfer.signed_ticket) - http.endheaders() - + http.request("OPTIONS", destination_url.path) r = http.getresponse() data = r.read() @@ -298,7 +299,6 @@ def pread(h, count, offset): transfer = h['transfer'] headers = {"...
2018 Jun 14
0
Re: [PATCH] v2v: -o rhv-upload: Optimize http request sending
...39;transfer_service'] > > - http.putrequest("GET", h['path']) > + headers = {"Range", "bytes=%d-%d" % (offset, offset+count-1)} > # Authorization is only needed for old imageio. > if h['needs_auth']: > - http.putheader("Authorization", transfer.signed_ticket) > - http.putheader("Range", "bytes=%d-%d" % (offset, offset+count-1)) > - http.endheaders() > + headers["Authorization"] = transfer.signed_ticket > + > + http.request("GET", h[&...
2018 Jun 14
0
Re: [PATCH] v2v: -o rhv-upload: Optimize http request sending
...;transfer_service'] > > - http.putrequest("GET", h['path']) > + headers = {"Range", "bytes=%d-%d" % (offset, offset+count-1)} > # Authorization is only needed for old imageio. > if h['needs_auth']: > - http.putheader("Authorization", transfer.signed_ticket) > - http.putheader("Range", "bytes=%d-%d" % (offset, offset+count-1)) > - http.endheaders() > + headers["Authorization"] = transfer.signed_ticket > + > + http.request("GET", h[&...
2018 Mar 12
2
[PATCH] v2v: -o rhv-upload: Support zero requests.
Only compile tested. I'm keeping this as a separate patch for the moment until the relevant change on the oVirt side goes upstream. Rich.
2018 Dec 07
2
[PATCH] v2v: -o rhv-upload: Fix emulated zero
...these # requests as long as they are smaller than the highest write seen. # After that we must emulate them with writes. if offset+count < h['highestwrite']: http.putrequest("PUT", h['path']) if h['needs_auth']: http.putheader("Authorization", transfer.signed_ticket) http.putheader("Content-Range", "bytes %d-%d/*" % (offset, offset+count-1)) http.putheader("Content-Length", str(count)) http.endheaders() try:...
2018 Jun 29
0
Re: [PATCH] v2v: rhv-upload-plugin: Remove unneeded auth
...municating with old imageio-proxy. > needs_auth = not params['rhv_direct'] > + > can_flush = False > can_trim = False > can_zero = False > unix_socket = None > > - http.putrequest("OPTIONS", destination_url.path) > - http.putheader("Authorization", transfer.signed_ticket) > - http.endheaders() > - > + http.request("OPTIONS", destination_url.path) > r = http.getresponse() > data = r.read() > > @@ -298,7 +299,6 @@ def pread(h, count, offset): > transfer = h['...
2018 Mar 24
4
Re: [PATCH v7 6/6] v2v: Add -o rhv-upload output mode (RHBZ#1557273).
...> +def get_options(h): > + if h['got_options']: > + return > + h['got_options'] = True > + > + http = h['http'] > + transfer=h['transfer'] > + > + http.putrequest("OPTIONS", h['path']) > + http.putheader("Authorization", transfer.signed_ticket) > + http.endheaders() > + > + r = http.getresponse() > + if r.status == 200: > + j = json.loads(r.read()) > + h['can_zero'] = "zero" in j['features'] > + h['can_trim...
2018 Mar 12
0
[PATCH] v2v: -o rhv-upload: Support zero requests.
...highestwrite'], offset+count) - do_pwrite(h, buf, offset, count) - -def do_pwrite(h, buf, offset, count): - http = h['http'] - transfer=h['transfer'] - transfer_service=h['transfer_service'] http.putrequest("PUT", h['path']) http.putheader("Authorization", transfer.signed_ticket) @@ -214,19 +209,28 @@ def do_pwrite(h, buf, offset, count): raise RuntimeError("could not write sector (%d, %d): %d: %s" % (offset, count, r.status, r.reason)) -# qemu-img convert starts by trying to...
2018 Aug 20
0
[PATCH 1/2] v2v: rhv-upload-plugin: Handle send send failures
...da..7327ea4c5 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -17,6 +17,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import builtins +import errno import json import logging import socket @@ -357,7 +358,12 @@ def pwrite(h, buf, offset): http.putheader("Content-Range", "bytes %d-%d/*" % (offset, offset+count-1)) http.putheader("Content-Length", str(count)) http.endheaders() - http.send(buf) + + try: + http.send(buf) + except socket.error as e: + if e[0] != errno.EPIPE: + ra...
2018 Dec 07
0
Re: [PATCH] v2v: -o rhv-upload: Fix emulated zero
...long as they are smaller than the highest write seen. > # After that we must emulate them with writes. > if offset+count < h['highestwrite']: > http.putrequest("PUT", h['path']) > if h['needs_auth']: > http.putheader("Authorization", transfer.signed_ticket) > http.putheader("Content-Range", > "bytes %d-%d/*" % (offset, offset+count-1)) > http.putheader("Content-Length", str(count)) > http.endheaders() > &...
2018 Mar 21
2
[PATCH v6] v2v: Add -o rhv-upload output mode.
v5 was here: https://www.redhat.com/archives/libguestfs/2018-March/msg00032.html There is only a single patch in this version because the other patches went upstream. This patch adds the virt-v2v -o rhv-upload mode (https://bugzilla.redhat.com/show_bug.cgi?id=1557273). Compared to v5, this adds the ability to make zero, trim and flush requests to the oVirt imageio server
2018 Mar 22
0
[PATCH v7 6/6] v2v: Add -o rhv-upload output mode (RHBZ#1557273).
...} + +# Can we issue zero, trim or flush requests? +def get_options(h): + if h['got_options']: + return + h['got_options'] = True + + http = h['http'] + transfer=h['transfer'] + + http.putrequest("OPTIONS", h['path']) + http.putheader("Authorization", transfer.signed_ticket) + http.endheaders() + + r = http.getresponse() + if r.status == 200: + j = json.loads(r.read()) + h['can_zero'] = "zero" in j['features'] + h['can_trim'] = "trim" in j['f...
2018 Mar 21
3
Re: [PATCH v6] v2v: Add -o rhv-upload output mode.
...> +def get_options(h): > + if h['got_options']: > + return > + h['got_options'] = True > + > + http = h['http'] > + transfer=h['transfer'] > + > + http.putrequest("OPTIONS", h['path']) > + http.putheader("Authorization", transfer.signed_ticket) > + http.endheaders() > + > + r = http.getresponse() > + if r.status == 200: > + j = json.loads(r.read()) > + h['can_zero'] = "zero" in j['features'] > + h['can_trim...
2018 Mar 22
0
Re: [PATCH v6] v2v: Add -o rhv-upload output mode.
On Wed, Mar 21, 2018 at 08:08:37PM +0000, Nir Soffer wrote: > > + http.putheader("Authorization", transfer.signed_ticket) > > + # The oVirt server only uses the first part of the range, and the > > + # content-length. > > + http.putheader("Content-Range", "bytes %d-%d/*" % (offset, > > offset+count-1)) > > +...
2018 Jun 25
1
Re: [PATCH v2 1/2] v2v: -o rhv-upload: Always fetch server options when opening the connection.
...> + # The first request is to fetch the features of the server. > + needs_auth = not params['rhv_direct'] > + can_flush = False > + can_trim = False > + can_zero = False > + > + http.putrequest("OPTIONS", destination_url.path) > + http.putheader("Authorization", transfer.signed_ticket) + http.endheaders() > + > + r = http.getresponse() > We should read the response data here to make sure we consume the entire response before sending hte nex > + if r.status == 200: > + # New imageio never needs a...
2018 Mar 21
0
[PATCH v6] v2v: Add -o rhv-upload output mode.
...} + +# Can we issue zero, trim or flush requests? +def get_options(h): + if h['got_options']: + return + h['got_options'] = True + + http = h['http'] + transfer=h['transfer'] + + http.putrequest("OPTIONS", h['path']) + http.putheader("Authorization", transfer.signed_ticket) + http.endheaders() + + r = http.getresponse() + if r.status == 200: + j = json.loads(r.read()) + h['can_zero'] = "zero" in j['features'] + h['can_trim'] = "trim" in j['f...
2018 Aug 20
3
[PATCH 0/2] v2v: rhv-upload-plugin: Improve error handling
These patches improve error handling when PUT request fail, including the error response from oVirt server. This will make it easier to debug issue when oVirt server logs have been rotated. Nir Soffer (2): v2v: rhv-upload-plugin: Handle send send failures v2v: rhv-upload-plugin: Fix error formatting v2v/rhv-upload-plugin.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7
2018 Mar 25
0
Re: [PATCH v7 6/6] v2v: Add -o rhv-upload output mode (RHBZ#1557273).
...h['got_options']: > > + return > > + h['got_options'] = True > > + > > + http = h['http'] > > + transfer=h['transfer'] > > + > > + http.putrequest("OPTIONS", h['path']) > > + http.putheader("Authorization", transfer.signed_ticket) > > + http.endheaders() > > + > > + r = http.getresponse() > > + if r.status == 200: > > + j = json.loads(r.read()) > > + h['can_zero'] = "zero" in j['features'] &...
2018 Jun 22
4
v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
v1 was here: https://www.redhat.com/archives/libguestfs/2018-June/msg00099.html v2: - Just fixes the two problems noted in the review of the previous version. Rich.