Skip to content

Commit

Permalink
Improve HttpProxy logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Jul 23, 2024
1 parent 88c2fd5 commit 2c81189
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tdnet/td/net/HttpProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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());
}
Expand Down

0 comments on commit 2c81189

Please sign in to comment.