Re: Installing on Win95, network problems Win95 / libwww
Karl-Heinz Volk (Volk@physik.uni-bremen.de)
Fri, 09 Jan 1998 10:12:01 +0100
Elizabeth Mattijsen wrote:
> Michael G Schwern wrote:
> > [...]
> > If you're using Guru Sarathay's port of perl to win32, you'll note
> in the
> > README file (you DID read the readme, didn't you?) that A) it comes
> with
> > libwww already, B) its made to run on WinNT and is untested on
> Win95.
>
> Though I would not claim to "test" it I can say it works quite well
> on Win95. So far I've used quite a couple of modules and built some
> from CPAN (e.g. libwww-perl 5.18 - the GSAR bundle has 5.13).
> Gurusamy Sarathy's bundle comes with dmake, which is completely
> sufficient to make libwww-perl and many other modules on Win95.
>
> > [...]
> > Guru's Perl5.004_02 port can be gotten from
> > http://www.perl.com/CPAN/ports/win32/Standard but like I said, it
> probably
> > won't work on Win95. From all reports I've heard about people using
> Guru's
> > Perl on Win95, none of the networking stuff will work.
>
> Then let me add a report: Some of the networking stuff works on Win95.
>
> - libwww-perl (all you need for e.g. link checkers or HTTP daemons)
> - Net::FTP, Net::NNTP, News::NNTPClient
> Could you give an example of networking stuff which does not work?
> Or any other evidence why you say it probably won't work on Win95?
> --
> Oook,
> --haj--
I have got a very strage error with libwww under Win95: I used the
httpd-example
from the documentation to devellop a html-document of-line. This
document
contained a <form> with a <textarea>. The Text-area was posted and the
perl-httpd
replied with a html-document containing the <textarea>. If the textarea
contained more
than some 370 bytes, netcape communicator 4.01 (and microsoft
internetexploerer 3.0)
complaines, that "A Network error occurred while Netscape was receiving
data. (Network
Error: Connection reset by peer)". Microsoft Internet Explorer 4.0 is
working well and makes
no problem. The same script works fine with LinuX (SuSe-distribution
5.0) and all browsers.
An upgrade to libwww 5.18 under Win95 and WinSock 2.0 makes no
differrence. And it is
only the length of the text in the <textarea> which is a problem. The
-text sent back
by the daemon as a response to the posted request may be of any length.
I am working
with: Windows 95. [Version 4.00.1111] and perl, version 5.004_02 on two
computers.
Can someone explain this strage thing. I append the source to this
letter.
Karl-Heinz Volk
-------------------------------- cut here
------------------------------------
use strict;
use HTTP::Daemon;
use HTTP::Response;
my $daemon = new HTTP::Daemon (LocalPort => 80);
my ($current, $request, $response);
my ($arg, $key, $val, $script);
my $url = $daemon->url;
print "http server contact: \n"; print "identification:
", $daemon->product_tokens, "\n"; print "\n";
while ($current = $daemon->accept) {
$request = $current->get_request;
if ($request) {
if ($request->method eq 'GET') {
$response = new HTTP::Response;
$response->content (&genhtml);
$current->send_response ($response);
$response = undef;
} elsif ($request->method eq 'POST') {
foreach $arg (split "&", $request->content) {
($key, $val) = split "=", $arg;
$script = &unescape($val) if $key eq "script";
}
$response = new HTTP::Response;
$response->content (&genhtml);
$current->send_response ($response);
$response = undef;
}
}
$current = undef; # close connection
}
sub genhtml {
my $msg = <
EOF
return ($msg);
}
sub unescape {
my($todecode) = @_;
$todecode =~ tr/+/ /;
$todecode =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
return $todecode;
}