From e82f6fd0ba45e37545c28e2c08ad97f2aa2129ba Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 1 Mar 2018 23:39:15 +0000 Subject: [PATCH] Reconnect on socket issues if using http --- src/danog/MadelineProto/Connection.php | 2 +- src/danog/MadelineProto/MTProtoTools/CallHandler.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/danog/MadelineProto/Connection.php b/src/danog/MadelineProto/Connection.php index 6cb3f1d17..33c0c0832 100644 --- a/src/danog/MadelineProto/Connection.php +++ b/src/danog/MadelineProto/Connection.php @@ -247,7 +247,7 @@ class Connection public function read($length) { - \danog\MadelineProto\Logger::log(["Asked to read $length"], \danog\MadelineProto\Logger::ULTRA_VERBOSE); + //\danog\MadelineProto\Logger::log(["Asked to read $length"], \danog\MadelineProto\Logger::ULTRA_VERBOSE); switch ($this->protocol) { case 'obfuscated2': $packet = ''; diff --git a/src/danog/MadelineProto/MTProtoTools/CallHandler.php b/src/danog/MadelineProto/MTProtoTools/CallHandler.php index b3701e6c5..55f3b3bb9 100644 --- a/src/danog/MadelineProto/MTProtoTools/CallHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/CallHandler.php @@ -185,6 +185,7 @@ trait CallHandler } catch (\danog\MadelineProto\NothingInTheSocketException $e) { $last_error = 'Nothing in the socket'; \danog\MadelineProto\Logger::log(['An error getting response of method '.$method.': '.$e->getMessage().' in '.basename($e->getFile(), '.php').' on line '.$e->getLine().'. Retrying...'], \danog\MadelineProto\Logger::WARNING); + if ($this->is_http($aargs['datacenter'])) $this->close_and_reopen($aargs['datacenter']); continue; //2; } }