Thread [LWP::UserAgent] "Ein nicht blockierender Socketvorgang konnte nicht sofort ausgeführt werden" (Perl 5.18 64bit)
(33 answers)
Opened by bianca at 2015-03-23 07:43
Hab meinen virtuellen Schreibtisch mal aufgeräumt. Aktueller Stand ist dieser:
![]() ![]() ![]() ![]() ![]() LWP mit SSL geht Net::FTP mit SSL geht nicht, "IO::Socket::SSL >= 2.007 needed for SSL support" SOAP::Lite mit SSL geht Jetzt mach ich das Update für ![]() LWP mit SSL geht meistens nicht mehr: "500 Status read failed: Ein nicht blockierender Socketvorgang konnte nicht sofort ausgeführt werden at C:/strawberry/perl/vendor/lib/Net/HTTP/Methods.pm line 276" Net::FTP mit SSL geht jetzt SOAP::Lite mit SSL geht auch nicht mehr: "no element found at line 1, column 0, byte -1 at C:/strawberry/perl/vendor/lib/XML/Parser.pm line 187" aus der Methods.pm: Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 READ: { die "read timeout" unless $self->can_read; my $n = $self->sysread($_, 1024, length); unless (defined $n) { redo READ if $!{EINTR} || $!{EAGAIN}; # if we have already accumulated some data let's at least # return that as a line die "$what read failed: $!" unless length; # <= ZEILE 276 } unless ($n) { return undef unless length; return substr($_, 0, length, ""); } } aus der Parser.pm: Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 my @result = (); my $result; eval { $result = $expat->parse($arg); # <= Zeile 187 }; my $err = $@; if ($err) { $expat->release; die $err; } Laut Doku von ![]() ![]() Zur Zertifikatsprüfung wird ab dort standardmäßig auch nicht mehr ![]() ![]() ![]() ![]() ![]() Hab mir als Übergangslösung deshalb ![]() Leider führt das bisher alles nicht zur Lösung. Nur etwa jeder fünfte Versuch meines Requests mit LWP funktioniert. Wenn ich ![]() Warum ist das so? Wieso nur häufig aber nicht immer? Mit diesem Script kann man das Problem nachstellen: Code (perl): (dl
)
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 #!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 1 } ); $ua->add_handler("request_send", sub { print "\n\n***** Request *****\n"; shift->dump; return }); $ua->add_handler("response_done", sub { print "\n\n***** Response *****\n"; shift->dump; return }); my $stop = 0; my $versuch = 0; my %felder = ( foo => 'bar' ); while(!$stop) { $versuch ++; print "////// VERSUCH $versuch \\\\\\\\\\\\\n"; my $response = $ua->post('https: //ssl. ibanrechner .de/http.html',\%felder); # BLANKS ENTFERNEN!!! $stop = 1 if $response->is_success; } print "\n\n-------------------------------------------------------------\n"; print "Version IO::Socket::SSL: ".(defined $IO::Socket::SSL::VERSION ? $IO::Socket::SSL::VERSION : '- nicht inst. -')."\n"; print "Version Crypt::SSLeay: ".(defined $Crypt::SSLeay::VERSION ? $Crypt::SSLeay::VERSION : '- nicht inst. -')."\n"; print "Version LWP::UserAgent: ".$LWP::UserAgent::VERSION."\n"; print "Version Mozilla::CA: ".(defined $Mozilla::CA::VERSION ? $Mozilla::CA::VERSION : '- nicht inst. -')."\n"; Wollte euch bitten, das Script mal so 5, 6 mal hintereinander in der Konsole zu starten und zu schauen, ob es jedes mal nach Versuch 1 stehen bleibt oder mehr Versuche braucht. Und unten die Versionsinfos und Betriebssystem bräuchte ich dann bitte dazu. Würdet mir damit sehr helfen, Danke. 10 print "Hallo"
20 goto 10 |