From dd43474e7566c87318a3c93e5111e4526dc75a74 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 9 May 2018 11:37:58 +0000 Subject: [PATCH] Reduce memory usage --- src/danog/MadelineProto/Server/Proxy.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/danog/MadelineProto/Server/Proxy.php b/src/danog/MadelineProto/Server/Proxy.php index 8e4d5628..9fd2e36b 100644 --- a/src/danog/MadelineProto/Server/Proxy.php +++ b/src/danog/MadelineProto/Server/Proxy.php @@ -70,6 +70,8 @@ class Proxy extends \danog\MadelineProto\Connection $socket = $this->extra['madeline']->API->datacenter->sockets[$dc]; $socket->__construct($socket->proxy, $socket->extra, $socket->ip, $socket->port, $socket->protocol, $this->extra['timeout'], $socket->ipv6); + unset($this->extra); + $write = []; $except = []; @@ -80,11 +82,11 @@ class Proxy extends \danog\MadelineProto\Connection $read = [$this->getSocket(), $socket->getSocket()]; \Socket::select($read, $write, $except, 2); if (isset($read[0])) { - \danog\MadelineProto\Logger::log("Will write to DC $dc on ".\danog\MadelineProto\Magic::$pid); + //\danog\MadelineProto\Logger::log("Will write to DC $dc on ".\danog\MadelineProto\Magic::$pid); $socket->send_message($this->read_message()); } if (isset($read[1])) { - \danog\MadelineProto\Logger::log("Will read from DC $dc on ".\danog\MadelineProto\Magic::$pid); + //\danog\MadelineProto\Logger::log("Will read from DC $dc on ".\danog\MadelineProto\Magic::$pid); $this->send_message($socket->read_message()); } } catch (\danog\MadelineProto\NothingInTheSocketException $e) {