summaryrefslogtreecommitdiffstats
path: root/perl-install/http.pm
blob: 8d1e8d5de9d91c7f8b7e36e32806cd3af6ab44bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package http; # $Id$

use IO::Socket;
use network;


my $sock;

sub getFile {
    local($^W) = 0;

    my ($url) = @_;
    $sock->close if $sock;
    $url =~ m|/XXX$| and return; #- force closing connection.

    my ($host, $port, $path) = $url =~ m,^http://([^/:]+)(?::(\d+))?(/\S*)?$,;
    $host = network::resolv($host);

    $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
    my ($now, $last, $buf, $tmp) = 0;
    my $read = sub { sysread($sock, $buf, 1) || die; $tmp .= $buf };
    do {
	$last = $now;
	&$read; &$read if $buf =~ /\015/;
	$now = $buf =~ /\012/;
    } until ($now && $last);

    $tmp =~ /^.*\b200\b/ ? $sock : undef;
}

1;
ll?id=944a02d563c478e5b8f1ae275cd7d0fb0379dbe5'>Add nokmsboot boot option also if the bootloader is installed after setting ↵Anssi Hannula2011-04-173-0/+10 | | | | up a conflicting display driver (e.g. draklive-install). * service_harddrake: Add or remove nokmsboot option if an unoptimal or fatal ↵Anssi Hannula2011-04-172-1/+14 | | | | situation is detected. * service_harddrake: Do not switch a display driver if speedboot has already ↵Anssi Hannula2011-04-172-0/+10 | | | | started X server, in that case simply disable speedboot for next boot. * service_harddrake: ask for a reboot after a driver switch if needed, and ↵Anssi Hannula2011-04-172-2/+25 | | | | load the new driver if no reboot is needed * service_harddrake: handle adding/removing nokmsboot when switching the driver.Anssi Hannula2011-04-172-0/+5 | * service_harddrake: Factorize ask_with_timeout for a following commit.Anssi Hannula2011-04-172-12/+20 | * service_harddrake: Adapt from bootsplash to plymouth.Anssi Hannula2011-04-172-7/+5 | * - fixed header so msgfmt wont give any errorsOliver Burger2011-04-161-4/+3 | * - any.pm: make it easier for rebranding by using %s magicAhmad Samir2011-04-0773-783/+1145 | | | | | - update po/pot files * - s/Ldap/LDAP/ in the po/pot files manually so as not to fuzzy the strings ↵Ahmad Samir2011-04-0771-174/+174 | | | | unnecessarily * - keep it "Hard drive detection", since the tree on the left in the installerAhmad Samir2011-04-071-2/+2 | | | | | is of limited width * - s/can not/cannot/ manually in the po/pot files so as not the make the stringsAhmad Samir2011-04-07285-1456/+1456 | | | | | unnecessarily fuzzy (from Thierry Vignaud) * - revert 's,/boot partition,separate /boot partition,', .po/pot files shouldn'tAhmad Samir2011-04-0571-214/+214 | | | | | | be changed this way as this changes the meaning of the string and translators need to adapt the .po files themselves * - 's!Just select your tv card parameters!Just select your TV card parameters!'Ahmad Samir2011-04-0472-73/+73 | * - s/api/API/Ahmad Samir2011-04-0472-173/+173 | * - perl -pi -e 's!trouble shoot!troubleshoot!'Ahmad Samir2011-04-0472-145/+145 | * - perl -pi -e 's!you can pick one in the above list!you can pick one from ↵Ahmad Samir2011-04-0472-72/+72 | | | | the above list!' * - perl -pi -e 's!For this, create a partition!To accomplish this, create a ↵Ahmad Samir2011-04-0472-72/+72 | | | | partition!' * - perl -pi -e 's!"Search new servers"!"Search for new servers"!'Ahmad Samir2011-04-0472-72/+72 | * - perl -pi -e 's!Something bad is happening on your drive!Something bad is ↵Ahmad Samir2011-04-0472-72/+72 | | | | happening on your hard disk drive!' * - perl -pi -e 's!"Activate ethernet cards promiscuity check."!"Activate ↵Ahmad Samir2011-04-0472-72/+72 | | | | Ethernet cards promiscuity check."!' * - perl -pi -e 's!Posix!POSIX!'Ahmad Samir2011-04-04