From ac351894b014c3ac49916f5893ad85b5be488074 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 22 2015 12:03:44 +0000 Subject: Retrieve the complete http request made to the server But we still only want the first line to act upon --- diff --git a/ev-server/pagure-stream-server.py b/ev-server/pagure-stream-server.py index 811fcc0..2112ba4 100644 --- a/ev-server/pagure-stream-server.py +++ b/ev-server/pagure-stream-server.py @@ -95,10 +95,17 @@ def get_obj_from_path(path): @trollius.coroutine def handle_client(client_reader, client_writer): - # give client a chance to respond, timeout after 10 seconds - data = yield trollius.From(trollius.wait_for( - client_reader.readline(), - timeout=10.0)) + data = None + while True: + # give client a chance to respond, timeout after 10 seconds + line = yield trollius.From(trollius.wait_for( + client_reader.readline(), + timeout=10.0)) + if not line.decode().strip(): + break + line = line.decode().rstrip() + if data is None: + data = line if data is None: log.warning("Expected ticket uid, received None")