From 521bd45737514a8c8766009b5d637dad3f20b2c4 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 30 Nov 2017 11:35:37 +0100 Subject: [PATCH] ipv6 fixes --- src/danog/MadelineProto/MTProto.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index 1f463c97..f37bb665 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -292,7 +292,13 @@ class MTProto } } // Detect ipv6 + $oldipv6 = $this->ipv6; $this->ipv6 = (bool) strlen(@file_get_contents('http://ipv6.test-ipv6.com/', false, stream_context_create(['http' => ['timeout' => 1]]))) > 0; + + if ($oldipv6 !== $this->ipv6) { + $this->settings['connection_settings']['all']['ipv6'] = $this->ipv6; + $this->parse_settings($this->settings); + } preg_match('/const V = (\d+);/', @file_get_contents('https://raw.githubusercontent.com/danog/MadelineProto/master/src/danog/MadelineProto/MTProto.php'), $matches); $keys = array_keys((array) get_object_vars($this)); if (count($keys) !== count(array_unique($keys))) {