Changeset 229

Show
Ignore:
Timestamp:
04/11/07 12:16:07 (2 years ago)
Author:
ludo
Message:

v1.0.4: fixes in remaining connection attempts (from r4210)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/webmin/lsc/debian/changelog

    r227 r229  
    1 webmin-lsc (1.0.3) stable; urgency=low 
     1webmin-lsc (1.0.4) stable; urgency=low 
    22 
    33  * See SVN history 
  • trunk/webmin/lsc/include/command_launcher.inc.php

    r227 r229  
    554554                if ( $mac != "" ) { 
    555555                        $remains_connection_attempt = lsc_command_on_host_get_remains_connection_attempt($this->id_command_on_host); 
    556                         while($remains_connection_attempt >= 0) { 
     556                        while($remains_connection_attempt > 0) { 
    557557                                $this->command_on_host->refresh(); 
    558558                                 
     
    629629                                        lsc_command_on_host_set_remains_connection_attempt( 
    630630                                                $this->id_command_on_host,  
    631                                                 $remains_connection_attempt-- 
     631                                                --$remains_connection_attempt 
    632632                                        ); 
    633633                 
     
    636636                                                time() + ($this->command->next_connection_delay * 60) 
    637637                                        ); 
    638                  
     638                                         
     639                                        if ($remains_connection_attempt <= 0) return -1; 
     640                                         
    639641                                        sleep($this->command->next_connection_delay * 60); 
    640642                                } 
  • trunk/webmin/lsc/include/commands.inc.php

    r227 r229  
    763763        } 
    764764 
     765        // should we kill the running job if available ? 
     766 
    765767        $query = sprintf( 
    766768" 
     
    768770                %s 
    769771        SET 
    770                 current_state = \"stop\" 
     772                current_state = \"stop\", 
     773                current_pid = -1 
    771774        WHERE 
    772775                id_command = \"%s\" and 
     
    810813        WHERE 
    811814                id_command = \"%s\" and 
    812                 current_state = \"upload_failed\" 
    813 ", 
     815                current_state = \"upload_failed\"  ", 
    814816                COMMANDS_ON_HOST_TABLE, 
    815817                $id_command 
  • trunk/webmin/lsc/include/commands_on_host.inc.php

    r227 r229  
    981981        } 
    982982 
    983         /* 
    984          * 
    985          */ 
     983        /* Reset the connection attempts */ 
     984 
     985        $database->query("UPDATE ".COMMANDS_ON_HOST_TABLE."  
     986                SET current_pid=-1 
     987                WHERE id_command=\"$id_command_on_host\""); 
     988        $database->query("UPDATE ".COMMANDS_ON_HOST_TABLE."  
     989                SET number_attempt_connection_remains=1 
     990                WHERE id_command=\"$id_command_on_host\" AND number_attempt_connection_remains=0"); 
     991 
    986992        $query = sprintf( 
    987993" 
     
    10841090 
    10851091 
     1092 
    10861093?> 
  • trunk/webmin/lsc/include/scheduler.inc.php

    r227 r229  
    331331                                        NOT (A.current_state = \"delete_failed\") and 
    332332                                        NOT (A.current_state = \"inventory_failed\") and 
     333                                        (A.number_attempt_connection_remains > 0) and 
    333334                                        (A.current_pid = \"-1\") 
    334335                                ORDER BY 
  • trunk/webmin/lsc/module.info

    r227 r229  
    33desc_fr=LRS : Prise de Contrôle à Distance Sécurisé 
    44depends=1.030 lbs_common 
    5 version=1.0.3 
     5version=1.0.4