Changeset 32809 for main/trunk
- Timestamp:
- 2019-02-25T16:59:01+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/downloaders/WgetDownload.pm
r32779 r32809 716 716 $full_text .= $line; 717 717 } else { # error or EOF 718 if(!defined $len) { # error reading 719 #print STDERR "WgetDownload: Error reading from child stream: $!\n"; 720 $error = 1; 721 } 722 if(!defined $len) { 718 if(!defined $len) { # could be an error reading 719 # On Windows, the socket ends up forcibly closed on the "other" side. It's just the way it's implemented 720 # on Windows when using sockets to our child process' iostreams. So $len not being defined is not an error in that case. Refer to 721 # https://stackoverflow.com/questions/16675950/perl-select-returning-undef-on-sysread-when-using-windows-ipcopen3-and-ios/16676271 723 722 if(!$!{ECONNRESET}) { # anything other ECONNRESET error means it's a real case of undefined $len being an error 724 #print STDERR "WgetDownload: Error reading from child stream: $!\n"; 723 print STDERR "WgetDownload: Error reading from child stream: $!\n"; 724 # SHOULD THIS 'die "errmsg";' instead? - no, sockets may need closing 725 725 $error = 1; 726 } else { # the error code is ECONNRESET, and it's not an error, despite $len being undefined. 727 # Happens on Windows when using sockets to a child process' iostreams 726 } else { # $! contains message "An existing connection was forcibly closed by remote host" where "remote" is a reference to the sockets to our wget child process, 727 # NOT to the remote web server we're downloading from. In such a case, the error code is ECONNRESET, and it's not an error, despite $len being undefined. 728 # Happens on Windows when using sockets to a child process' iostreams 728 729 #print STDERR "WgetDownload: wget finished\n"; 729 730 }
Note:
See TracChangeset
for help on using the changeset viewer.