Changeset 17664


Ignore:
Timestamp:
2008-10-31T19:01:20+13:00 (15 years ago)
Author:
ak19
Message:

In the case of OAIDownloads, WgetDownload no longer uses sockets for terminating wget. The original GS2 2.80 did a better job in terminating the multiple wgets launched, by just letting the Java code do a process.destroy() on the perl script which--although it would let the current download finish--would not launch further wget instances.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/downloaders/WgetDownload.pm

    r17549 r17664  
    188188}
    189189
     190# Returns true if the wget status needs to be monitored through sockets
     191# (if a socket is used to communicate with the Java program on when to
     192# terminate wget). True if we are running gli, or if the particular type
     193# of WgetDownload is *not* OAIDownload (in that case, the original way of
     194# terminating the perl script from Java terminated wget as well).
     195sub dealingWithSockets() {
     196    my ($self) = @_;
     197    return (defined $self->{'gli'} && $self->{'gli'} && !defined $port && ref($self) ne "OAIDownload");
     198                       # use ref($self) to find the classname of an object
     199}
     200
    190201sub useWget
    191202{
     
    209220    # Instead, when wget has to be terminated in the middle of execution, GLI will
    210221    # connect to a serverSocket here to communicate when it's time to stop wget.
    211     if(defined $self->{'gli'} && $self->{'gli'} && !defined $port) {
     222    if($self->dealingWithSockets()) {
    212223
    213224    $port = <STDIN>; # gets a port on localhost that's not yet in use
     
    336347    # Instead, when wget has to be terminated in the middle of execution, GLI will
    337348    # connect to a serverSocket here to communicate when it's time to stop wget.
    338     if(defined $self->{'gli'} && $self->{'gli'} && !defined $port) {
     349    if($self->dealingWithSockets()) {
    339350
    340351    $port = <STDIN>; # gets a port on localhost that's not yet in use
Note: See TracChangeset for help on using the changeset viewer.