Add logging of HttpProxy response.
GitOrigin-RevId: a7ad02206e0c6515d38a7f0b767735f25eb6c7c1
This commit is contained in:
parent
811d24f1ba
commit
b777051eaa
@ -7,6 +7,7 @@
|
|||||||
#include "td/net/HttpProxy.h"
|
#include "td/net/HttpProxy.h"
|
||||||
|
|
||||||
#include "td/utils/base64.h"
|
#include "td/utils/base64.h"
|
||||||
|
#include "td/utils/format.h"
|
||||||
#include "td/utils/logging.h"
|
#include "td/utils/logging.h"
|
||||||
#include "td/utils/misc.h"
|
#include "td/utils/misc.h"
|
||||||
#include "td/utils/Slice.h"
|
#include "td/utils/Slice.h"
|
||||||
@ -41,6 +42,10 @@ Status HttpProxy::wait_connect_response() {
|
|||||||
it.advance(12, begin);
|
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]) ||
|
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])) {
|
!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");
|
return Status::Error("Failed to connect");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user