From b777051eaa1383bd627750e50e7f23f14734e6f4 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 6 Dec 2018 20:29:10 +0300 Subject: [PATCH] Add logging of HttpProxy response. GitOrigin-RevId: a7ad02206e0c6515d38a7f0b767735f25eb6c7c1 --- tdnet/td/net/HttpProxy.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tdnet/td/net/HttpProxy.cpp b/tdnet/td/net/HttpProxy.cpp index 9ffaed96b..318fb5937 100644 --- a/tdnet/td/net/HttpProxy.cpp +++ b/tdnet/td/net/HttpProxy.cpp @@ -7,6 +7,7 @@ #include "td/net/HttpProxy.h" #include "td/utils/base64.h" +#include "td/utils/format.h" #include "td/utils/logging.h" #include "td/utils/misc.h" #include "td/utils/Slice.h" @@ -41,6 +42,10 @@ Status HttpProxy::wait_connect_response() { it.advance(12, begin); if ((begin.substr(0, 10) != "HTTP/1.1 2" && begin.substr(0, 10) != "HTTP/1.0 2") || !is_digit(begin[10]) || !is_digit(begin[11])) { + char buf[1024]; + size_t len = min(sizeof(buf), it.size()); + it.advance(len, MutableSlice{buf, sizeof(buf)}); + VLOG(proxy) << "Failed to connect: " << format::escaped(Slice(buf, len)); return Status::Error("Failed to connect"); }