From 673ceec47e9c1651ed891eb914facd7c0b233120 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Sat, 6 Feb 2021 04:22:45 -0700 Subject: [PATCH] Revert "Add support to sync via http proxy" This reverts commit c5f6f416123df1f3f234b614c1b70c3a65e47c6f. --- Rocksolid_Light/rocksolid/newsportal.php | 24 ++----------------- Rocksolid_Light/rslight/rslight.inc.php | 2 -- .../rslight/scripts/setuphelper.php | 2 -- Rocksolid_Light/rslight/scripts/spoolnews.php | 5 +--- 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 081504f..c45e292 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -98,15 +98,11 @@ function nntp2_open($nserver=0,$nport=0) { } else { if(isset($CONFIG['socks_host']) && $CONFIG['socks_host'] !== '') { $ns=fsocks4asockopen($CONFIG['socks_host'], $CONFIG['socks_port'], $nserver, $nport); - } elseif(isset($CONFIG['http_host']) && $CONFIG['http_host'] !== '') { - $ns=fhttpsockopen($CONFIG['http_host'], $CONFIG['http_port'], $nserver, $nport); } else { $ns=@fsockopen('tcp://'.$nserver.":".$nport); } } - if(isset($CONFIG['http_host']) && $CONFIG['http_host'] !== '') { - fputs($ns, "MODE reader\r\n"); - } +// $ns=@fsockopen($nserver,$nport); $weg=line_read($ns); // kill the first line if (substr($weg,0,2) != "20") { echo "

".$text_error["error:"].$weg."

"; @@ -151,27 +147,11 @@ function fsocks4asockopen($proxyHostname, $proxyPort, $targetHostname, $targetPo if($values["ret"] == 0x5a) return $sock; else { - fclose($sock); + fclose(sock); return false; } } -function fhttpsockopen($proxyHostname, $proxyPort, $targetHostname, $targetPort) -{ - $sock = fsockopen($proxyHostname, $proxyPort); - if($sock === false) - return false; - fwrite($sock, 'CONNECT '.$targetHostname.':'.$targetPort.' HTTP/1.0'); - fwrite($sock, "\r\n"); - fwrite($sock, "\r\n"); - $weg=line_read($sock); - while (substr($weg,0,2) != "20") { - echo $weg."\r\n"; - $weg=line_read($sock); - } - return $sock; -} - /* * Close a NNTP connection * diff --git a/Rocksolid_Light/rslight/rslight.inc.php b/Rocksolid_Light/rslight/rslight.inc.php index 2a8ba71..998af8c 100644 --- a/Rocksolid_Light/rslight/rslight.inc.php +++ b/Rocksolid_Light/rslight/rslight.inc.php @@ -5,8 +5,6 @@ return [ 'remote_ssl' => '', 'socks_host' => '', 'socks_port' => '', - 'http_host' => '', - 'http_port' => '', 'remote_auth_user' => 'username', 'remote_auth_pass' => 'password', 'enable_nntp' => '1', diff --git a/Rocksolid_Light/rslight/scripts/setuphelper.php b/Rocksolid_Light/rslight/scripts/setuphelper.php index c0a09a2..c5001b9 100644 --- a/Rocksolid_Light/rslight/scripts/setuphelper.php +++ b/Rocksolid_Light/rslight/scripts/setuphelper.php @@ -13,8 +13,6 @@ return [ 'remote_auth_pass' => 'Password to authenticate to remote server', 'socks_host' => 'ip address of your socks4a server (use this for tor)', 'socks_port' => 'port for your socks4a server', -'http_host' => 'ip address of your http proxy server (use this for i2p or create client tunnel)', -'http_port' => 'port for your http proxy server', # LOCAL server configuration 'enable_nntp' => 'Enable local nntp server (1=true, blank=false)', diff --git a/Rocksolid_Light/rslight/scripts/spoolnews.php b/Rocksolid_Light/rslight/scripts/spoolnews.php index 587563e..8261521 100755 --- a/Rocksolid_Light/rslight/scripts/spoolnews.php +++ b/Rocksolid_Light/rslight/scripts/spoolnews.php @@ -138,6 +138,7 @@ function get_articles($ns, $group) { $banned_names = file("/etc/rslight/banned_names.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $nocem_check="@@NCM"; + # Check if group exists. Open it if it does fputs($ns, "group ".$group."\r\n"); $response = line_read($ns); @@ -222,10 +223,6 @@ function get_articles($ns, $group) { if (strcmp(substr($response,0,3),"220") != 0) { echo "\n".$response."\n"; file_put_contents($logfile, "\n".format_log_date()." ".$config_name." Unexpected response to ARTICLE command: ".$response, FILE_APPEND); - if(trim($response) == '') { - fclose($ns); - break; - } $article++; continue; }