Displaying 20 results from an estimated 58 matches for "putrequest".
2018 Jun 14
5
[PATCH] v2v: -o rhv-upload: Optimize http request sending
.../rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index ed99cc7a9..3fad865f6 100644
--- a/v2v/rhv-upload-plugin.py
+++ b/v2v/rhv-upload-plugin.py
@@ -263,12 +263,12 @@ def pread(h, count, offset):
transfer = h['transfer']
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.puthe...
2018 Jun 29
2
[PATCH] v2v: rhv-upload-plugin: Remove unneeded auth
...the features of the server.
+
+ # Authentication was needed 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):...
2018 Jun 14
0
Re: [PATCH] v2v: -o rhv-upload: Optimize http request sending
...-plugin.py
> index ed99cc7a9..3fad865f6 100644
> --- a/v2v/rhv-upload-plugin.py
> +++ b/v2v/rhv-upload-plugin.py
> @@ -263,12 +263,12 @@ def pread(h, count, offset):
> transfer = h['transfer']
> 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_tic...
2018 Jun 14
0
Re: [PATCH] v2v: -o rhv-upload: Optimize http request sending
...lugin.py
> index ed99cc7a9..3fad865f6 100644
> --- a/v2v/rhv-upload-plugin.py
> +++ b/v2v/rhv-upload-plugin.py
> @@ -263,12 +263,12 @@ def pread(h, count, offset):
> transfer = h['transfer']
> 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_tic...
2019 Nov 19
5
Re: [PATCH v2 00/11] rvh-upload: Various fixes and cleanups
...#39;], body=buf, headers=headers)\n', ' File "/usr/lib64/python3.7/http/client.py", line 1252, in request\n self._send_request(method, url, body, headers, encode_chunked)\n', ' File "/usr/lib64/python3.7/http/client.py", line 1263, in _send_request\n self.putrequest(method, url, **skips)\n', ' File "/usr/lib64/python3.7/http/client.py", line 1108, in putrequest\n raise CannotSendRequest(self.__state)\n', 'http.client.CannotSendRequest: Request-sent\n']
nbdkit: python[1]: debug: sending error reply: Input/output error
nbdkit: p...
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 Jun 29
0
Re: [PATCH] v2v: rhv-upload-plugin: Remove unneeded auth
...ication was needed 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,...
2018 Mar 24
4
Re: [PATCH v7 6/6] v2v: Add -o rhv-upload output mode (RHBZ#1557273).
...ne.
[snipped]
> +# 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'] = "ze...
2018 Jun 25
1
Re: [PATCH v2 1/2] v2v: -o rhv-upload: Always fetch server options when opening the connection.
...def open(readonly):
> context = context
> )
>
> + # 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
>...
2018 Mar 25
0
Re: [PATCH v7 6/6] v2v: Add -o rhv-upload output mode (RHBZ#1557273).
...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())
> > +...
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.
2019 Nov 21
1
[PATCH] rhv-upload: Handle any error in NBD handlers
...#39;], body=buf, headers=headers)\n', ' File "/usr/lib64/python3.7/http/client.py", line 1252, in request\n self._send_request(method, url, body, headers, encode_chunked)\n', ' File "/usr/lib64/python3.7/http/client.py", line 1263, in _send_request\n self.putrequest(method, url, **skips)\n', ' File "/usr/lib64/python3.7/http/client.py", line 1108, in putrequest\n raise CannotSendRequest(self.__state)\n', 'http.client.CannotSendRequest: Request-sent\n']
nbdkit: python[1]: debug: sending error reply: Input/output error
nbdkit: p...
2018 Mar 12
0
[PATCH] v2v: -o rhv-upload: Support zero requests.
...t = len(buf)
- h['highestwrite'] = max(h['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.stat...
2018 Jun 21
0
[PATCH 1/2] v2v: -o rhv-upload: Always fetch server options when opening the connection.
...b/v2v/rhv-upload-plugin.py
@@ -165,63 +165,60 @@ def open(readonly):
context = context
)
+ # 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()
+ if r.status == 200:
+ # New imageio never needs authentication.
+ needs_auth = False
+
+ j = json.loads(r....
2018 Jun 22
0
[PATCH v2 1/2] v2v: -o rhv-upload: Always fetch server options when opening the connection.
...b/v2v/rhv-upload-plugin.py
@@ -165,63 +165,60 @@ def open(readonly):
context = context
)
+ # 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()
+ if r.status == 200:
+ # New imageio never needs authentication.
+ needs_auth = False
+
+ j = json.loads(r....
2019 Nov 19
2
Re: [PATCH v2 00/11] rvh-upload: Various fixes and cleanups
On Tue, Nov 19, 2019 at 2:16 PM Martin Kletzander <mkletzan@redhat.com>
wrote:
> On Tue, Nov 19, 2019 at 01:14:23PM +0200, Nir Soffer wrote:
> >On Tue, Nov 19, 2019 at 11:17 AM Martin Kletzander <mkletzan@redhat.com>
> wrote:
> >>
> >> On Mon, Nov 18, 2019 at 11:53:39PM +0200, Nir Soffer wrote:
> >> >This series extract oVirt SDK and imageio
2018 Dec 07
2
[PATCH] v2v: -o rhv-upload: Fix emulated zero
...to zero/trim the whole device.
# Since we've just created a new disk it's safe to ignore 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.puth...
2019 Nov 19
0
Re: [PATCH v2 00/11] rvh-upload: Various fixes and cleanups
...f, headers=headers)\n', ' File
> "/usr/lib64/python3.7/http/client.py", line 1252, in request\n
> self._send_request(method, url, body, headers, encode_chunked)\n', ' File
> "/usr/lib64/python3.7/http/client.py", line 1263, in _send_request\n
> self.putrequest(method, url, **skips)\n', ' File
> "/usr/lib64/python3.7/http/client.py", line 1108, in putrequest\n raise
> CannotSendRequest(self.__state)\n', 'http.client.CannotSendRequest:
> Request-sent\n']
>
Looks like you cannot communicate with imageio daemon...
2018 Mar 26
0
Re: [PATCH v7 6/6] v2v: Add -o rhv-upload output mode (RHBZ#1557273).
...+ 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:
>> > &...
2018 Mar 25
6
Re: [PATCH v7 6/6] v2v: Add -o rhv-upload output mode (RHBZ#1557273).
..._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.lo...