From 2c81189790e5c21f82159a8afc04bb81f9135a5e Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 23 Jul 2024 15:54:56 +0300 Subject: [PATCH] Improve HttpProxy logging. --- tdnet/td/net/HttpProxy.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tdnet/td/net/HttpProxy.cpp b/tdnet/td/net/HttpProxy.cpp index 35f682185..9d8250ef3 100644 --- a/tdnet/td/net/HttpProxy.cpp +++ b/tdnet/td/net/HttpProxy.cpp @@ -26,6 +26,7 @@ void HttpProxy::send_connect() { if (!username_.empty() || !password_.empty()) { auto userinfo = PSTRING() << username_ << ':' << password_; proxy_authorization = PSTRING() << "Proxy-Authorization: basic " << base64_encode(userinfo) << "\r\n"; + VLOG(proxy) << "Use credentials to connect to proxy: " << proxy_authorization; } fd_.output_buffer().append(PSLICE() << "CONNECT " << host << " HTTP/1.1\r\n" << "Host: " << host << "\r\n" @@ -47,7 +48,7 @@ Status HttpProxy::wait_connect_response() { 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)); + VLOG(proxy) << "Failed to connect: " << format::escaped(begin) << format::escaped(Slice(buf, len)); return Status::Error(PSLICE() << "Failed to connect to " << ip_address_.get_ip_host() << ':' << ip_address_.get_port()); }