Commit 6ae3cef7 authored by Alexandre's avatar Alexandre
Browse files

With HTTP/2 streams perform the first query alone

This allows to establish the connection to the server
and to instantiate the multi interface.
Without this all the handles are created and added to
the multi interface. When we run the multi_perform no
connection is already established putting all the
handles except one in a waiting mode. This seems to
have an impact on the timer of each transfer (they
start too early not reflecting the real elapsed time).
parent 03041d89
......@@ -548,6 +548,10 @@ class ConnectionDoH(Connection):
self.read_result_handle(handle)
if ret != pycurl.E_CALL_MULTI_PERFORM:
break
if not sync:
n, handle_pass, handle_fail = self.multi.info_read()
for handle in handle_pass:
self.read_result_handle(handle)
def send(self, handle):
handle.buffer = io.BytesIO()
......@@ -1095,6 +1099,11 @@ for connectTo in ip_set:
if not print_result(conn, request):
ok = False
if tests > 1 and i == 0:
if multistreams: # do the first query alone
# to establish the connection and hence avoid starting
# the transfer of all the other queries
conn.perform_multi()
conn.first_handle = conn.all_handles[0]
start2 = time.time()
if delay is not None:
time.sleep(delay)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment