package http; # $Id$ use IO::Socket; use network; my $sock; sub getFile { local($^W) = 0; my ($host, $port, $path) = $ENV{URLPREFIX} =~ m,^http://([^/:]+)(?::(\d+))?(/\S*)?$,; $host = network::resolv($host); $path .= "/$_[0]"; $sock->close if $sock; $_[0] eq 'XXX' and return; #- force closing connection. $sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port || 80, Proto => 'tcp', Timeout => 60) or die "can't connect "; $sock->autoflush; print $sock join("\015\012" => "GET $path HTTP/1.0", "Host: $host" . ($port && ":$port"), "User-Agent: DrakX/vivelinuxabaszindozs", "", ""); #- skip until empty line local $_; my ($now, $last, $tmp) = 0; my $read = sub { sysread($sock, $_, 1) || die; $tmp .= $_ }; do { $last = $now; &$read; &$read if /\015/; $now = /\012/; } until ($now && $last); $tmp =~ /^.*\b200\b/ ? $sock : undef; } 1; option> The forums.mageia.org WebsiteMaat [maat]
aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textformatter/utils_interface.php
diff options
context:
space:
mode:
authorlavigor <lavigor@users.noreply.github.com>2016-02-27 20:05:59 +0300
committerlavigor <lavigor@users.noreply.github.com>2016-02-27 20:05:59 +0300
commit40bd4c8b721bccec4f889a035934fc8db3b66c92 (patch)
tree0ba9b170f47faf4a2fb580840b23498da579e48e /phpBB/phpbb/textformatter/utils_interface.php
parent4b4584bcd43ed1148869b2c834be127b6b9da880 (diff)
downloadforums-40bd4c8b721bccec4f889a035934fc8db3b66c92.tar
forums-40bd4c8b721bccec4f889a035934fc8db3b66c92.tar.gz
forums-40bd4c8b721bccec4f889a035934fc8db3b66c92.tar.bz2
forums-40bd4c8b721bccec4f889a035934fc8db3b66c92.tar.xz
forums-40bd4c8b721bccec4f889a035934fc8db3b66c92.zip
[ticket/14486] Use empty() and move error check.
PHPBB3-14486
Diffstat (limited to 'phpBB/phpbb/textformatter/utils_interface.php')
0 files changed, 0 insertions, 0 deletions