Use pfs for media download

GitOrigin-RevId: afaa0e04f02b2b3dfb8822dacd56c0473b019527
This commit is contained in:
Arseny Smirnov 2018-05-31 16:56:06 +03:00
parent 2ede0fc336
commit bd9c88794e
2 changed files with 11 additions and 8 deletions

View File

@ -146,19 +146,22 @@ Status NetQueryDispatcher::wait_dc_init(DcId dc_id, bool force) {
int32 slow_net_scheduler_id = G()->get_slow_net_scheduler_id();
auto raw_dc_id = dc_id.get_raw_id();
int32 upload_session_count = raw_dc_id != 2 && raw_dc_id != 4 ? 8 : 4;
int32 download_session_count = 1;
int32 download_small_session_count = 1;
dc.main_session_ = create_actor<SessionMultiProxy>(PSLICE() << "SessionMultiProxy:" << raw_dc_id << ":main",
session_count, auth_data, raw_dc_id == main_dc_id_,
use_pfs || (session_count > 1), false, false, is_cdn);
dc.upload_session_ = create_actor_on_scheduler<SessionMultiProxy>(
PSLICE() << "SessionMultiProxy:" << raw_dc_id << ":upload", slow_net_scheduler_id,
raw_dc_id != 2 && raw_dc_id != 4 ? 8 : 4, auth_data, false, use_pfs || (session_count > 1), false, true,
is_cdn);
PSLICE() << "SessionMultiProxy:" << raw_dc_id << ":upload", slow_net_scheduler_id, upload_session_count,
auth_data, false, use_pfs, false, true, is_cdn);
dc.download_session_ = create_actor_on_scheduler<SessionMultiProxy>(
PSLICE() << "SessionMultiProxy:" << raw_dc_id << ":download", slow_net_scheduler_id, 1, auth_data, false,
use_pfs, true, true, is_cdn);
PSLICE() << "SessionMultiProxy:" << raw_dc_id << ":download", slow_net_scheduler_id, download_session_count,
auth_data, false, use_pfs || (download_session_count > 1), true, true, is_cdn);
dc.download_small_session_ = create_actor_on_scheduler<SessionMultiProxy>(
PSLICE() << "SessionMultiProxy:" << raw_dc_id << ":download_small", slow_net_scheduler_id, 1, auth_data, false,
use_pfs, true, true, is_cdn);
PSLICE() << "SessionMultiProxy:" << raw_dc_id << ":download_small", slow_net_scheduler_id,
download_small_session_count, auth_data, false, use_pfs || (download_small_session_count > 1), true, true,
is_cdn);
dc.is_inited_ = true;
if (dc_id.is_internal()) {
send_closure_later(dc_auth_manager_, &DcAuthManager::add_dc, std::move(auth_data));

View File

@ -96,7 +96,7 @@ void SessionMultiProxy::start_up() {
}
bool SessionMultiProxy::get_pfs_flag() const {
return (!allow_media_only_ && use_pfs_); // pfs is not supported in media only DCs
return use_pfs_;
}
void SessionMultiProxy::init() {