aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libpathod/pathoc.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py
index 89b0e0c9..ba15e630 100644
--- a/libpathod/pathoc.py
+++ b/libpathod/pathoc.py
@@ -209,8 +209,7 @@ class Pathoc(tcp.TCPClient):
)
self.protocol = http2.HTTP2Protocol(self, dump_frames=self.http2_framedump)
else:
- # TODO: create HTTP or Websockets protocol
- self.protocol = None
+ self.protocol = http1.HTTP1Protocol(self)
self.settings = language.Settings(
is_client=True,
@@ -409,16 +408,8 @@ class Pathoc(tcp.TCPClient):
req = language.serve(r, self.wfile, self.settings)
self.wfile.flush()
- if self.use_http2:
- status_code, headers, body = self.protocol.read_response()
- resp = http.Response("HTTP/2", status_code, "", headers, body, self.sslinfo)
- else:
- resp = http.http1.read_response(
- self.rfile,
- req["method"],
- None
- )
- resp.sslinfo = self.sslinfo
+ resp = self.protocol.read_response(req["method"], None)
+ resp.sslinfo = self.sslinfo
except http.HttpError as v:
lg("Invalid server response: %s" % v)
raise