From e075c524884e5a6de6406d7c616ffbbc86f1003c Mon Sep 17 00:00:00 2001 From: mykola2312 <49044616+mykola2312@users.noreply.github.com> Date: Wed, 16 Mar 2022 17:37:16 +0200 Subject: [PATCH] SQL bug fixed, now working correctly! --- announce.php | 2 +- network.php | 2 +- tracker.sql | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/announce.php b/announce.php index bb55ea3..bfdd749 100644 --- a/announce.php +++ b/announce.php @@ -104,7 +104,7 @@ if (!$ipAddr = inet_pton($ip)) { if (isset($_GET["port"])) { $port = intval(urldecode($_GET["port"])); } else { - bad_request("No port"); + bad_request("No port"); } $externalIp = get_external_ip(); diff --git a/network.php b/network.php index 91e2f57..180811f 100644 --- a/network.php +++ b/network.php @@ -35,7 +35,7 @@ function get_external_ip() $result = curl_exec($ch); curl_close($ch); - if (result == false) { + if ($result == false) { throw new Exception("request to ident.me failed"); } else if (inet_pton($result) == false) { throw new Exception("ident.me respond invalid ip"); diff --git a/tracker.sql b/tracker.sql index e66331f..bb48340 100644 --- a/tracker.sql +++ b/tracker.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: localhost --- Generation Time: Mar 16, 2022 at 01:15 PM +-- Generation Time: Mar 16, 2022 at 03:35 PM -- Server version: 10.7.3-MariaDB -- PHP Version: 7.4.28 @@ -30,7 +30,7 @@ SET time_zone = "+00:00"; CREATE TABLE `tracker` ( `info_hash` char(40) COLLATE utf8mb4_unicode_ci NOT NULL, `ip` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, - `port` smallint(5) NOT NULL, + `port` smallint(5) UNSIGNED NOT NULL, `update_time` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;