summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td/tdnet
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-06-04 19:24:05 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-06-04 19:24:05 +0300
commitefc336e60cf1331bf5f3213d296981b87b8b2a6c (patch)
treeea59ea1a324f45f6e8a06cc0887b376bfba90ca9 /protocols/Telegram/tdlib/td/tdnet
parent6e83622d2af1cec3c759f4cff6efe4df2fe3328c (diff)
fixes #3537 (Telegram: 32-разрядная версия падает в 64-разрядной Windows) + update to the fresh TDLIB
Diffstat (limited to 'protocols/Telegram/tdlib/td/tdnet')
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/DarwinHttp.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/DarwinHttp.mm2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/GetHostByNameActor.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/GetHostByNameActor.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpChunkedByteFlow.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpChunkedByteFlow.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpConnectionBase.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpConnectionBase.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpContentLengthByteFlow.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpContentLengthByteFlow.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpFile.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpFile.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpHeaderCreator.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpInboundConnection.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpInboundConnection.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpOutboundConnection.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpOutboundConnection.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpProxy.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpProxy.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpQuery.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpQuery.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpReader.cpp66
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/HttpReader.h11
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/NetStats.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/Socks5.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/Socks5.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/SslCtx.cpp144
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/SslCtx.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/SslStream.cpp4
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/SslStream.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/TcpListener.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/TcpListener.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/TransparentProxy.cpp8
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/TransparentProxy.h2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/Wget.cpp2
-rw-r--r--protocols/Telegram/tdlib/td/tdnet/td/net/Wget.h2
36 files changed, 178 insertions, 117 deletions
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/DarwinHttp.h b/protocols/Telegram/tdlib/td/tdnet/td/net/DarwinHttp.h
index 42c0a5b000..56383c15a5 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/DarwinHttp.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/DarwinHttp.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/DarwinHttp.mm b/protocols/Telegram/tdlib/td/tdnet/td/net/DarwinHttp.mm
index f8e285433f..1b90e59add 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/DarwinHttp.mm
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/DarwinHttp.mm
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/GetHostByNameActor.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/GetHostByNameActor.cpp
index 8a720083c0..b2426c6e82 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/GetHostByNameActor.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/GetHostByNameActor.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/GetHostByNameActor.h b/protocols/Telegram/tdlib/td/tdnet/td/net/GetHostByNameActor.h
index f864b13e3c..7cc61f248d 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/GetHostByNameActor.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/GetHostByNameActor.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpChunkedByteFlow.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpChunkedByteFlow.cpp
index 259e1fafbd..f3fb3e43aa 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpChunkedByteFlow.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpChunkedByteFlow.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpChunkedByteFlow.h b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpChunkedByteFlow.h
index 8e248ebb73..d8723dbeea 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpChunkedByteFlow.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpChunkedByteFlow.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpConnectionBase.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpConnectionBase.cpp
index c1f630ea1a..df8a7e132f 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpConnectionBase.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpConnectionBase.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpConnectionBase.h b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpConnectionBase.h
index 95373dc326..51da27d9fb 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpConnectionBase.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpConnectionBase.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpContentLengthByteFlow.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpContentLengthByteFlow.cpp
index 8493bd0997..1addec3a22 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpContentLengthByteFlow.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpContentLengthByteFlow.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpContentLengthByteFlow.h b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpContentLengthByteFlow.h
index 6ebb7d339f..9c459437ad 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpContentLengthByteFlow.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpContentLengthByteFlow.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpFile.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpFile.cpp
index 6ca6975ac8..cbd07362e4 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpFile.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpFile.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpFile.h b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpFile.h
index 7ba795eae2..11c7b737ae 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpFile.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpFile.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpHeaderCreator.h b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpHeaderCreator.h
index 72cebaf2be..04d9da2fcb 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpHeaderCreator.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpHeaderCreator.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpInboundConnection.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpInboundConnection.cpp
index 88a5ca9350..9748bdc01c 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpInboundConnection.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpInboundConnection.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpInboundConnection.h b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpInboundConnection.h
index b92e92c9b1..18b24efeec 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpInboundConnection.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpInboundConnection.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpOutboundConnection.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpOutboundConnection.cpp
index 2bf8073809..74e0073f79 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpOutboundConnection.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpOutboundConnection.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpOutboundConnection.h b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpOutboundConnection.h
index ca1f49f7d9..b4dd2cb022 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpOutboundConnection.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpOutboundConnection.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpProxy.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpProxy.cpp
index a676e691f6..e76ca54196 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpProxy.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpProxy.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpProxy.h b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpProxy.h
index fd9f6233ec..45b025fe3c 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpProxy.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpProxy.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpQuery.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpQuery.cpp
index 6cf0028f4d..03a506c94d 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpQuery.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpQuery.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpQuery.h b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpQuery.h
index 5abd4ae517..d702fafd50 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpQuery.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpQuery.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpReader.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpReader.cpp
index b86039052c..953495c1d2 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpReader.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpReader.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -84,7 +84,7 @@ Result<size_t> HttpReader::read_next(HttpQuery *query, bool can_be_slow) {
return Status::Error(501, "Unimplemented: unsupported transfer-encoding");
}
- if (content_encoding_.empty()) {
+ if (content_encoding_.empty() || content_encoding_ == "none") {
} else if (content_encoding_ == "gzip" || content_encoding_ == "deflate") {
gzip_flow_ = GzipByteFlow(Gzip::Mode::Decode);
GzipByteFlow::Options options;
@@ -162,7 +162,7 @@ Result<size_t> HttpReader::read_next(HttpQuery *query, bool can_be_slow) {
if (flow_sink_.is_ready()) {
CHECK(query_->container_.size() == 1u);
query_->container_.emplace_back(content_->cut_head(content_->size()).move_as_buffer_slice());
- query_->content_ = query_->container_.back().as_slice();
+ query_->content_ = query_->container_.back().as_mutable_slice();
break;
}
@@ -174,8 +174,8 @@ Result<size_t> HttpReader::read_next(HttpQuery *query, bool can_be_slow) {
}
// save content to a file
if (temp_file_.empty()) {
- auto file = open_temp_file("file");
- if (file.is_error()) {
+ auto open_status = open_temp_file("file");
+ if (open_status.is_error()) {
return Status::Error(500, "Internal Server Error: can't create temporary file");
}
}
@@ -207,9 +207,9 @@ Result<size_t> HttpReader::read_next(HttpQuery *query, bool can_be_slow) {
query_->container_.emplace_back(content_->cut_head(size).move_as_buffer_slice());
Status result;
if (content_type_lowercased_.find("application/x-www-form-urlencoded") != string::npos) {
- result = parse_parameters(query_->container_.back().as_slice());
+ result = parse_parameters(query_->container_.back().as_mutable_slice());
} else {
- result = parse_json_parameters(query_->container_.back().as_slice());
+ result = parse_json_parameters(query_->container_.back().as_mutable_slice());
}
if (result.is_error()) {
if (result.code() == 413) {
@@ -293,7 +293,7 @@ Result<bool> HttpReader::parse_multipart_form_data(bool can_be_slow) {
CHECK(temp_file_.empty());
temp_file_name_.clear();
- Parser headers_parser(headers.as_slice());
+ Parser headers_parser(headers.as_mutable_slice());
while (headers_parser.status().is_ok() && !headers_parser.data().empty()) {
MutableSlice header_name = headers_parser.read_till(':');
headers_parser.skip(':');
@@ -378,6 +378,7 @@ Result<bool> HttpReader::parse_multipart_form_data(bool can_be_slow) {
header_value = MutableSlice();
}
}
+ value = url_decode_inplace(value, false);
if (key == "name") {
field_name_ = value;
@@ -408,10 +409,6 @@ Result<bool> HttpReader::parse_multipart_form_data(bool can_be_slow) {
if (query_->files_.size() == max_files_) {
return Status::Error(413, "Request Entity Too Large: too many files attached");
}
- auto file = open_temp_file(file_name_);
- if (file.is_error()) {
- return Status::Error(500, "Internal Server Error: can't create temporary file");
- }
// don't need to save headers for files
file_field_name_ = field_name_.str();
@@ -436,7 +433,7 @@ Result<bool> HttpReader::parse_multipart_form_data(bool can_be_slow) {
}
query_->container_.emplace_back(content_->cut_head(form_data_read_length_).move_as_buffer_slice());
- MutableSlice value = query_->container_.back().as_slice();
+ MutableSlice value = query_->container_.back().as_mutable_slice();
content_->advance(boundary_.size());
form_data_skipped_length_ += form_data_read_length_ + boundary_.size();
form_data_read_length_ = 0;
@@ -467,6 +464,12 @@ Result<bool> HttpReader::parse_multipart_form_data(bool can_be_slow) {
if (!can_be_slow) {
return Status::Error("SLOW");
}
+ if (temp_file_.empty()) {
+ auto open_status = open_temp_file(file_name_);
+ if (open_status.is_error()) {
+ return Status::Error(500, "Internal Server Error: can't create temporary file");
+ }
+ }
if (find_boundary(content_->clone(), boundary_, form_data_read_length_)) {
auto file_part = content_->cut_head(form_data_read_length_).move_as_buffer_slice();
content_->advance(boundary_.size());
@@ -536,7 +539,7 @@ Result<size_t> HttpReader::split_header() {
CHECK(query_->container_.back().size() == headers_read_length_ + 2);
input_->advance(2);
total_headers_length_ = headers_read_length_;
- auto status = parse_head(query_->container_.back().as_slice());
+ auto status = parse_head(query_->container_.back().as_mutable_slice());
if (status.is_error()) {
return std::move(status);
}
@@ -639,7 +642,7 @@ Status HttpReader::parse_json_parameters(MutableSlice parameters) {
return Status::Error(400, "Bad Request: extra data after string");
}
query_->container_.emplace_back("content");
- query_->args_.emplace_back(query_->container_.back().as_slice(), r_value.move_as_ok());
+ query_->args_.emplace_back(query_->container_.back().as_mutable_slice(), r_value.move_as_ok());
return Status::OK();
}
parser.skip('{');
@@ -695,6 +698,18 @@ Status HttpReader::parse_json_parameters(MutableSlice parameters) {
return Status::OK();
}
+Status HttpReader::parse_http_version(Slice version) {
+ if (version == "HTTP/1.1") {
+ query_->keep_alive_ = true;
+ } else if (version == "HTTP/1.0") {
+ query_->keep_alive_ = false;
+ } else {
+ LOG(INFO) << "Unsupported HTTP version: " << version;
+ return Status::Error(505, "HTTP Version Not Supported");
+ }
+ return Status::OK();
+}
+
Status HttpReader::parse_head(MutableSlice head) {
Parser parser(head);
@@ -706,16 +721,8 @@ Status HttpReader::parse_head(MutableSlice head) {
} else if (type == "POST") {
query_->type_ = HttpQuery::Type::Post;
} else if (type.size() >= 4 && type.substr(0, 4) == "HTTP") {
- if (type == "HTTP/1.1") {
- query_->type_ = HttpQuery::Type::Response;
- query_->keep_alive_ = true;
- } else if (type == "HTTP/1.0") {
- query_->type_ = HttpQuery::Type::Response;
- query_->keep_alive_ = false;
- } else {
- LOG(INFO) << "Unsupported HTTP version: " << type;
- return Status::Error(505, "HTTP Version Not Supported");
- }
+ TRY_STATUS(parse_http_version(type));
+ query_->type_ = HttpQuery::Type::Response;
} else {
LOG(INFO) << "Not Implemented " << tag("type", type) << tag("head", head);
return Status::Error(501, "Not Implemented");
@@ -736,12 +743,7 @@ Status HttpReader::parse_head(MutableSlice head) {
}
TRY_STATUS(parse_url(url_version.substr(0, space_pos)));
-
- auto http_version = url_version.substr(space_pos + 1);
- if (http_version != "HTTP/1.1" && http_version != "HTTP/1.0") {
- LOG(WARNING) << "Unsupported HTTP version: " << http_version;
- return Status::Error(505, "HTTP Version Not Supported");
- }
+ TRY_STATUS(parse_http_version(url_version.substr(space_pos + 1)));
}
parser.skip('\r');
parser.skip('\n');
@@ -800,7 +802,7 @@ Status HttpReader::open_temp_file(CSlice desired_file_name) {
}
rmdir(directory).ignore();
- LOG(WARNING) << "Failed to create temporary file " << desired_file_name << ": " << second_try.error();
+ LOG(WARNING) << "Failed to create temporary file \"" << desired_file_name << "\": " << second_try.error();
return second_try.move_as_error();
}
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpReader.h b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpReader.h
index 3851e74671..4c360435d3 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/HttpReader.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/HttpReader.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -30,10 +30,10 @@ class HttpReader {
Result<size_t> read_next(HttpQuery *query, bool can_be_slow = true) TD_WARN_UNUSED_RESULT; // TODO move query to init
HttpReader() = default;
- HttpReader(const HttpReader &other) = delete;
- HttpReader &operator=(const HttpReader &other) = delete;
- HttpReader(HttpReader &&other) = delete;
- HttpReader &operator=(HttpReader &&other) = delete;
+ HttpReader(const HttpReader &) = delete;
+ HttpReader &operator=(const HttpReader &) = delete;
+ HttpReader(HttpReader &&) = delete;
+ HttpReader &operator=(HttpReader &&) = delete;
~HttpReader() {
if (!temp_file_.empty()) {
clean_temporary_file();
@@ -93,6 +93,7 @@ class HttpReader {
Status parse_url(MutableSlice url) TD_WARN_UNUSED_RESULT;
Status parse_parameters(MutableSlice parameters) TD_WARN_UNUSED_RESULT;
Status parse_json_parameters(MutableSlice parameters) TD_WARN_UNUSED_RESULT;
+ Status parse_http_version(Slice version) TD_WARN_UNUSED_RESULT;
Status parse_head(MutableSlice head) TD_WARN_UNUSED_RESULT;
Status open_temp_file(CSlice desired_file_name) TD_WARN_UNUSED_RESULT;
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/NetStats.h b/protocols/Telegram/tdlib/td/tdnet/td/net/NetStats.h
index 325196b34c..81da1e95d1 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/NetStats.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/NetStats.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/Socks5.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/Socks5.cpp
index 04c52278e8..8db9343f62 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/Socks5.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/Socks5.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/Socks5.h b/protocols/Telegram/tdlib/td/tdnet/td/net/Socks5.h
index e438fb8d90..8624e87e4d 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/Socks5.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/Socks5.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/SslCtx.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/SslCtx.cpp
index 4ec0412e66..913a0202d0 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/SslCtx.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/SslCtx.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -10,7 +10,10 @@
#include "td/utils/crypto.h"
#include "td/utils/FlatHashMap.h"
#include "td/utils/logging.h"
+#include "td/utils/misc.h"
+#include "td/utils/port/path.h"
#include "td/utils/port/wstring_convert.h"
+#include "td/utils/ScopeGuard.h"
#include "td/utils/SliceBuilder.h"
#include "td/utils/Time.h"
@@ -18,6 +21,7 @@
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/x509.h>
+#include <openssl/x509_vfy.h>
#include <cstring>
#include <memory>
@@ -56,6 +60,97 @@ int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) {
return preverify_ok;
}
+X509_STORE *load_system_certificate_store() {
+ int32 cert_count = 0;
+ int32 file_count = 0;
+ LOG(DEBUG) << "Begin to load system certificate store";
+ SCOPE_EXIT {
+ LOG(DEBUG) << "End to load " << cert_count << " certificates from " << file_count << " files from system store";
+ if (ERR_peek_error() != 0) {
+ auto error = create_openssl_error(-22, "Have unprocessed errors");
+ LOG(INFO) << error;
+ }
+ };
+#if TD_PORT_WINDOWS
+ auto flags = CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_CURRENT_USER;
+ HCERTSTORE system_store =
+ CertOpenStore(CERT_STORE_PROV_SYSTEM_W, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, HCRYPTPROV_LEGACY(), flags,
+ static_cast<const void *>(to_wstring("ROOT").ok().c_str()));
+ if (!system_store) {
+ return nullptr;
+ }
+ X509_STORE *store = X509_STORE_new();
+ if (store == nullptr) {
+ return nullptr;
+ }
+
+ for (PCCERT_CONTEXT cert_context = CertEnumCertificatesInStore(system_store, nullptr); cert_context != nullptr;
+ cert_context = CertEnumCertificatesInStore(system_store, cert_context)) {
+ const unsigned char *in = cert_context->pbCertEncoded;
+ X509 *x509 = d2i_X509(nullptr, &in, static_cast<long>(cert_context->cbCertEncoded));
+ if (x509 != nullptr) {
+ if (X509_STORE_add_cert(store, x509) != 1) {
+ auto error_code = ERR_peek_error();
+ auto error = create_openssl_error(-20, "Failed to add certificate");
+ if (ERR_GET_REASON(error_code) != X509_R_CERT_ALREADY_IN_HASH_TABLE) {
+ LOG(ERROR) << error;
+ } else {
+ LOG(INFO) << error;
+ }
+ } else {
+ cert_count++;
+ }
+
+ X509_free(x509);
+ } else {
+ LOG(ERROR) << create_openssl_error(-21, "Failed to load X509 certificate");
+ }
+ }
+
+ CertCloseStore(system_store, 0);
+#else
+ X509_STORE *store = X509_STORE_new();
+ if (store == nullptr) {
+ return nullptr;
+ }
+
+ auto add_file = [&](CSlice path) {
+ if (X509_STORE_load_locations(store, path.c_str(), nullptr) != 1) {
+ auto error = create_openssl_error(-20, "Failed to add certificate");
+ LOG(INFO) << path << ": " << error;
+ } else {
+ file_count++;
+ }
+ };
+
+ string default_cert_dir = X509_get_default_cert_dir();
+ for (auto cert_dir : full_split(default_cert_dir, ':')) {
+ walk_path(cert_dir, [&](CSlice path, WalkPath::Type type) {
+ if (type != WalkPath::Type::RegularFile && type != WalkPath::Type::Symlink) {
+ return type == WalkPath::Type::EnterDir && path != cert_dir ? WalkPath::Action::SkipDir
+ : WalkPath::Action::Continue;
+ }
+ add_file(path);
+ return WalkPath::Action::Continue;
+ }).ignore();
+ }
+
+ string default_cert_path = X509_get_default_cert_file();
+ if (!default_cert_path.empty()) {
+ add_file(default_cert_path);
+ }
+
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ auto objects = X509_STORE_get0_objects(store);
+ cert_count = objects == nullptr ? 0 : sk_X509_OBJECT_num(objects);
+#else
+ cert_count = -1;
+#endif
+#endif
+
+ return store;
+}
+
using SslCtxPtr = std::shared_ptr<SSL_CTX>;
Result<SslCtxPtr> do_create_ssl_ctx(CSlice cert_file, SslCtx::VerifyPeer verify_peer) {
@@ -87,54 +182,17 @@ Result<SslCtxPtr> do_create_ssl_ctx(CSlice cert_file, SslCtx::VerifyPeer verify_
SSL_CTX_set_mode(ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | SSL_MODE_ENABLE_PARTIAL_WRITE);
if (cert_file.empty()) {
-#if TD_PORT_WINDOWS
- LOG(DEBUG) << "Begin to load system store";
- auto flags = CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_CURRENT_USER;
- HCERTSTORE system_store =
- CertOpenStore(CERT_STORE_PROV_SYSTEM_W, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, HCRYPTPROV_LEGACY(), flags,
- static_cast<const void *>(to_wstring("ROOT").ok().c_str()));
-
- if (system_store) {
- X509_STORE *store = X509_STORE_new();
-
- for (PCCERT_CONTEXT cert_context = CertEnumCertificatesInStore(system_store, nullptr); cert_context != nullptr;
- cert_context = CertEnumCertificatesInStore(system_store, cert_context)) {
- const unsigned char *in = cert_context->pbCertEncoded;
- X509 *x509 = d2i_X509(nullptr, &in, static_cast<long>(cert_context->cbCertEncoded));
- if (x509 != nullptr) {
- if (X509_STORE_add_cert(store, x509) != 1) {
- auto error_code = ERR_peek_error();
- auto error = create_openssl_error(-20, "Failed to add certificate");
- if (ERR_GET_REASON(error_code) != X509_R_CERT_ALREADY_IN_HASH_TABLE) {
- LOG(ERROR) << error;
- } else {
- LOG(INFO) << error;
- }
- }
-
- X509_free(x509);
- } else {
- LOG(ERROR) << create_openssl_error(-21, "Failed to load X509 certificate");
- }
- }
-
- CertCloseStore(system_store, 0);
-
- SSL_CTX_set_cert_store(ssl_ctx, store);
- LOG(DEBUG) << "End to load system store";
- } else {
- LOG(ERROR) << create_openssl_error(-22, "Failed to open system certificate store");
- }
-#else
- if (SSL_CTX_set_default_verify_paths(ssl_ctx) == 0) {
- auto error = create_openssl_error(-8, "Failed to load default verify paths");
+ auto *store = load_system_certificate_store();
+ if (store == nullptr) {
+ auto error = create_openssl_error(-8, "Failed to load system certificate store");
if (verify_peer == SslCtx::VerifyPeer::On) {
return std::move(error);
} else {
LOG(ERROR) << error;
}
+ } else {
+ SSL_CTX_set_cert_store(ssl_ctx, store);
}
-#endif
} else {
if (SSL_CTX_load_verify_locations(ssl_ctx, cert_file.c_str(), nullptr) == 0) {
return create_openssl_error(-8, "Failed to set custom certificate file");
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/SslCtx.h b/protocols/Telegram/tdlib/td/tdnet/td/net/SslCtx.h
index 5cd55925e5..48434ddedf 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/SslCtx.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/SslCtx.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/SslStream.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/SslStream.cpp
index bede94b0f1..0fd8d2594c 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/SslStream.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/SslStream.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -89,7 +89,7 @@ long strm_ctrl(BIO *b, int cmd, long num, void *ptr) {
case BIO_CTRL_PUSH:
case BIO_CTRL_POP:
return 0;
-#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
case BIO_CTRL_GET_KTLS_SEND:
case BIO_CTRL_GET_KTLS_RECV:
return 0;
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/SslStream.h b/protocols/Telegram/tdlib/td/tdnet/td/net/SslStream.h
index 286eb80be3..366c073ee0 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/SslStream.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/SslStream.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/TcpListener.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/TcpListener.cpp
index 7a8d280624..e3172bbb5e 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/TcpListener.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/TcpListener.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/TcpListener.h b/protocols/Telegram/tdlib/td/tdnet/td/net/TcpListener.h
index 84cf3c6874..9df31ca3ee 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/TcpListener.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/TcpListener.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/TransparentProxy.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/TransparentProxy.cpp
index b5102a37b4..025c0ca289 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/TransparentProxy.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/TransparentProxy.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -67,14 +67,14 @@ void TransparentProxy::loop() {
TRY_STATUS(fd_.flush_read());
TRY_STATUS(loop_impl());
TRY_STATUS(fd_.flush_write());
+ if (can_close_local(fd_)) {
+ return Status::Error("Connection closed");
+ }
return Status::OK();
}();
if (status.is_error()) {
on_error(std::move(status));
}
- if (can_close_local(fd_)) {
- on_error(Status::Error("Connection closed"));
- }
}
void TransparentProxy::timeout_expired() {
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/TransparentProxy.h b/protocols/Telegram/tdlib/td/tdnet/td/net/TransparentProxy.h
index 66a3830589..ab1e0ed29f 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/TransparentProxy.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/TransparentProxy.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/Wget.cpp b/protocols/Telegram/tdlib/td/tdnet/td/net/Wget.cpp
index f6a6c72eb8..230e881827 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/Wget.cpp
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/Wget.cpp
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/protocols/Telegram/tdlib/td/tdnet/td/net/Wget.h b/protocols/Telegram/tdlib/td/tdnet/td/net/Wget.h
index f3d225982b..2c78a522e7 100644
--- a/protocols/Telegram/tdlib/td/tdnet/td/net/Wget.h
+++ b/protocols/Telegram/tdlib/td/tdnet/td/net/Wget.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)