@@ -940,32 +940,33 @@ void Handshake::loadCdnConfig(Datacenter *datacenter) {
940
940
if (loadingCdnKeys) {
941
941
return ;
942
942
}
943
- if (cdnPublicKeysFingerprints.empty ()) {
944
- if (cdnConfig == nullptr ) {
945
- cdnConfig = new Config (datacenter->instanceNum , " cdnkeys.dat" );
946
- }
947
- NativeByteBuffer *buffer = cdnConfig->readConfig ();
948
- if (buffer != nullptr ) {
949
- uint32_t version = buffer->readUint32 (nullptr );
950
- if (version >= 1 ) {
951
- size_t count = buffer->readUint32 (nullptr );
952
- for (uint32_t a = 0 ; a < count; a++) {
953
- int dcId = buffer->readInt32 (nullptr );
954
- cdnPublicKeys[dcId] = buffer->readString (nullptr );
955
- cdnPublicKeysFingerprints[dcId] = buffer->readUint64 (nullptr );
956
- }
957
- }
958
- buffer->reuse ();
959
- if (!cdnPublicKeysFingerprints.empty ()) {
960
- size_t count = cdnWaitingDatacenters.size ();
961
- for (uint32_t a = 0 ; a < count; a++) {
962
- cdnWaitingDatacenters[a]->beginHandshake (HandshakeTypeCurrent, false );
963
- }
964
- cdnWaitingDatacenters.clear ();
965
- return ;
966
- }
967
- }
968
- }
943
+ if (LOGS_ENABLED) DEBUG_D (" account%u dc%u loadCdnConfig" , datacenter->instanceNum , datacenter->datacenterId );
944
+ // if (cdnPublicKeysFingerprints.empty()) {
945
+ // if (cdnConfig == nullptr) {
946
+ // cdnConfig = new Config(datacenter->instanceNum, "cdnkeys.dat");
947
+ // }
948
+ // NativeByteBuffer *buffer = cdnConfig->readConfig();
949
+ // if (buffer != nullptr) {
950
+ // uint32_t version = buffer->readUint32(nullptr);
951
+ // if (version >= 1) {
952
+ // size_t count = buffer->readUint32(nullptr);
953
+ // for (uint32_t a = 0; a < count; a++) {
954
+ // int dcId = buffer->readInt32(nullptr);
955
+ // cdnPublicKeys[dcId] = buffer->readString(nullptr);
956
+ // cdnPublicKeysFingerprints[dcId] = buffer->readUint64(nullptr);
957
+ // }
958
+ // }
959
+ // buffer->reuse();
960
+ // if (!cdnPublicKeysFingerprints.empty()) {
961
+ // size_t count = cdnWaitingDatacenters.size();
962
+ // for (uint32_t a = 0; a < count; a++) {
963
+ // cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false);
964
+ // }
965
+ // cdnWaitingDatacenters.clear();
966
+ // return;
967
+ // }
968
+ // }
969
+ // }
969
970
loadingCdnKeys = true ;
970
971
auto request = new TL_help_getCdnConfig ();
971
972
@@ -1008,6 +1009,7 @@ void Handshake::loadCdnConfig(Datacenter *datacenter) {
1008
1009
buffer->reuse ();
1009
1010
BIO_free (keyBio);
1010
1011
count = cdnWaitingDatacenters.size ();
1012
+ if (LOGS_ENABLED) DEBUG_D (" account%u dc%u cdnConfig loaded begin handshake" , datacenter->instanceNum , datacenter->datacenterId );
1011
1013
for (uint32_t a = 0 ; a < count; a++) {
1012
1014
cdnWaitingDatacenters[a]->beginHandshake (HandshakeTypeCurrent, false );
1013
1015
}
0 commit comments