Skip to content

Commit

Permalink
Increase maximum file size.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: d4da965e7ecea03bc3eb356c41a81a715a06ace0
  • Loading branch information
levlam committed Jul 3, 2020
1 parent c4113c6 commit 2ac8c16
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion td/telegram/files/FileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

namespace td {
namespace {
constexpr int64 MAX_FILE_SIZE = 1500 * (1 << 20) /* 1500MB */;
constexpr int64 MAX_FILE_SIZE = 2000 * (1 << 20) /* 2000MB */;
} // namespace

int VERBOSITY_NAME(update_file) = VERBOSITY_NAME(INFO);
Expand Down
1 change: 0 additions & 1 deletion td/telegram/files/PartsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <numeric>

namespace td {
/*** PartsManager ***/

namespace {
int64 calc_part_count(int64 size, int64 part_size) {
Expand Down
7 changes: 3 additions & 4 deletions td/telegram/files/PartsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace td {

/*** PartsManager***/
struct Part {
int id;
int64 offset;
Expand Down Expand Up @@ -54,9 +53,9 @@ class PartsManager {
string get_bitmask();

private:
static constexpr int MAX_PART_COUNT = 3000;
static constexpr int MAX_PART_SIZE = 512 * (1 << 10);
static constexpr int64 MAX_FILE_SIZE = MAX_PART_SIZE * MAX_PART_COUNT;
static constexpr int MAX_PART_COUNT = 4000;
static constexpr size_t MAX_PART_SIZE = 512 * (1 << 10);
static constexpr int64 MAX_FILE_SIZE = static_cast<int64>(MAX_PART_SIZE) * MAX_PART_COUNT;

enum class PartStatus : int32 { Empty, Pending, Ready };

Expand Down
2 changes: 1 addition & 1 deletion tdnet/td/net/HttpReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class HttpReader {
static constexpr size_t MAX_TOTAL_PARAMETERS_LENGTH = 1 << 16; // Some reasonable limit
static constexpr size_t MAX_TOTAL_HEADERS_LENGTH = 1 << 18; // Some reasonable limit
static constexpr size_t MAX_BOUNDARY_LENGTH = 70; // As defined by RFC1341
static constexpr int64 MAX_FILE_SIZE = 1500 << 20; // Telegram server file size limit
static constexpr int64 MAX_FILE_SIZE = 2000 << 20; // Telegram server file size limit
static constexpr const char TEMP_DIRECTORY_PREFIX[] = "tdlib-server-tmp";
};

Expand Down

0 comments on commit 2ac8c16

Please sign in to comment.