From ad1552df63bad83f3e1f2a7773c668dd01c4e148 Mon Sep 17 00:00:00 2001 From: danogentili Date: Wed, 10 Aug 2016 13:56:35 +0200 Subject: [PATCH] Updated error handlign --- .travis.yml | 2 -- src/danog/MadelineProto/Session.php | 17 ++++++++++------- src/danog/MadelineProto/TL/TL.php | 1 - 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61592f98..b08f4f68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,5 @@ addons: packages: - python3 -before_script: - - composer update --dev script: - ./testing.php diff --git a/src/danog/MadelineProto/Session.php b/src/danog/MadelineProto/Session.php index ec506df6..cd930410 100644 --- a/src/danog/MadelineProto/Session.php +++ b/src/danog/MadelineProto/Session.php @@ -184,7 +184,7 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB } if (fstat($payload)['size'] == 4) { - throw new Exception('Server response error: '.$this->struct->unpack('struct->unpack('log->log('Starting Diffie Hellman key exchange'); $server_dh_params = $this->method_call('req_DH_params', - ['nonce' => $nonce, - 'server_nonce' => $server_nonce, - 'p' => $p_bytes, - 'q' => $q_bytes, - 'public_key_fingerprint' => $public_key_fingerprint, - 'encrypted_data' => $encrypted_data]); + [ + 'nonce' => $nonce, + 'server_nonce' => $server_nonce, + 'p' => $p_bytes, + 'q' => $q_bytes, + 'public_key_fingerprint' => $public_key_fingerprint, + 'encrypted_data' => $encrypted_data + ] + ); if ($nonce != $server_dh_params['nonce']) { throw new Exception('Handshake: wrong nonce.'); diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index ff3bce90..2203c667 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -98,7 +98,6 @@ class TL if (!is_numeric($value)) { throw new Exception("serialize_param: given value isn't numeric"); } - return \danog\PHP\Struct::pack('