784 |
|
|
785 |
my $status = -1; |
my $status = -1; |
786 |
|
|
787 |
warn $url; |
warn "## $url\n"; |
788 |
|
|
789 |
$url = new URI($url); |
$url = new URI($url); |
790 |
if ( |
if ( |
853 |
$self->{status} = $res_status; |
$self->{status} = $res_status; |
854 |
|
|
855 |
# skip rest of headers |
# skip rest of headers |
856 |
do { |
$line = <$sock>; |
857 |
|
while ($line) { |
858 |
$line = <$sock>; |
$line = <$sock>; |
859 |
chomp($line); |
$line =~ s/[\r\n]+$//; |
860 |
} until ($line eq ''); |
warn "## ", $line || 'NULL', " ##\n"; |
861 |
|
}; |
862 |
|
|
863 |
# read body |
# read body |
864 |
my $len = 0; |
$len = 0; |
865 |
do { |
do { |
866 |
$len = read($sock, my $buf, 8192); |
$len = read($sock, my $buf, 8192); |
867 |
$$resbody .= $buf if ($resbody); |
$$resbody .= $buf if ($resbody); |