version 1.107, 2018/12/10 17:34:22
|
version 1.110, 2024/06/14 18:49:41
|
Line 97 my $executable = $0; # Get the full
|
Line 97 my $executable = $0; # Get the full
|
my $RemoteHost; # Hostname of host child is talking to. |
my $RemoteHost; # Hostname of host child is talking to. |
my $RemoteHostId; # lonid of host child is talking to. |
my $RemoteHostId; # lonid of host child is talking to. |
my $RemoteDefHostId; # default lonhostID of host child is talking to. |
my $RemoteDefHostId; # default lonhostID of host child is talking to. |
|
my $RemoteLoncapaRev; # LON-CAPA version of host child is talking to, |
|
# if 2.12.0 or newer, format: X.Y.Z |
my @all_host_ids; |
my @all_host_ids; |
my $UnixSocketDir= $perlvar{'lonSockDir'}; |
my $UnixSocketDir= $perlvar{'lonSockDir'}; |
my $IdleConnections = Stack->new(); # Set of idle connections |
my $IdleConnections = Stack->new(); # Set of idle connections |
Line 613 sub CompleteTransaction {
|
Line 615 sub CompleteTransaction {
|
StartClientReply($Transaction, $data); |
StartClientReply($Transaction, $data); |
} else { # Delete deferred transaction file. |
} else { # Delete deferred transaction file. |
Log("SUCCESS", "A delayed transaction was completed"); |
Log("SUCCESS", "A delayed transaction was completed"); |
LogPerm("S:".$Socket->PeerLoncapaHim().":".$Transaction->getRequest()); |
LogPerm("S:".$Transaction->getClient().":".$Transaction->getRequest()); |
unlink($Transaction->getFile()); |
unlink($Transaction->getFile()); |
} |
} |
} |
} |
Line 671 Parameters:
|
Line 673 Parameters:
|
=item client |
=item client |
|
|
The LondTransaction we are failing. |
The LondTransaction we are failing. |
|
|
|
|
=cut |
=cut |
|
|
Line 1250 sub MakeLondConnection {
|
Line 1251 sub MakeLondConnection {
|
my $Connection = LondConnection->new(&GetServerHost(), |
my $Connection = LondConnection->new(&GetServerHost(), |
&GetServerPort(), |
&GetServerPort(), |
&GetHostId(), |
&GetHostId(), |
&GetDefHostId()); |
&GetDefHostId(), |
|
&GetLoncapaRev()); |
|
|
if($Connection eq undef) { |
if($Connection eq undef) { |
Log("CRITICAL","Failed to make a connection with lond."); |
Log("CRITICAL","Failed to make a connection with lond."); |
Line 1575 sub GetDefHostId {
|
Line 1577 sub GetDefHostId {
|
|
|
=pod |
=pod |
|
|
|
=head2 GetLoncapaRev |
|
|
|
Returns the LON-CAPA version for the node whose lond we talk with. |
|
|
|
=cut |
|
|
|
sub GetLoncapaRev { |
|
return $RemoteLoncapaRev; # Setup by the fork. |
|
} |
|
|
|
=pod |
|
|
=head2 GetServerPort |
=head2 GetServerPort |
|
|
Returns the lond port number. |
Returns the lond port number. |
Line 1836 sub ChildProcess {
|
Line 1850 sub ChildProcess {
|
# Create a new child for host passed in: |
# Create a new child for host passed in: |
|
|
sub CreateChild { |
sub CreateChild { |
my ($host, $hostid, $defhostid) = @_; |
my ($host, $hostid, $defhostid, $loncaparev) = @_; |
|
|
my $sigset = POSIX::SigSet->new(SIGINT); |
my $sigset = POSIX::SigSet->new(SIGINT); |
sigprocmask(SIG_BLOCK, $sigset); |
sigprocmask(SIG_BLOCK, $sigset); |
Line 1852 sub CreateChild {
|
Line 1866 sub CreateChild {
|
} else { # child. |
} else { # child. |
$RemoteHostId = $hostid; |
$RemoteHostId = $hostid; |
$RemoteDefHostId = $defhostid; |
$RemoteDefHostId = $defhostid; |
|
$RemoteLoncapaRev = $loncaparev; |
ShowStatus("Connected to ".$RemoteHost); |
ShowStatus("Connected to ".$RemoteHost); |
$SIG{INT} = 'DEFAULT'; |
$SIG{INT} = 'DEFAULT'; |
sigprocmask(SIG_UNBLOCK, $sigset); |
sigprocmask(SIG_UNBLOCK, $sigset); |
Line 1917 sub get_remote_hostname {
|
Line 1932 sub get_remote_hostname {
|
|
|
&Debug(5,"Creating child for $data (parent_client_connection)"); |
&Debug(5,"Creating child for $data (parent_client_connection)"); |
(my $hostname,my $lonid,@all_host_ids) = split(':',$data); |
(my $hostname,my $lonid,@all_host_ids) = split(':',$data); |
|
my $remotelcrev; |
|
if ((scalar(@all_host_ids) > 1) && ($all_host_ids[0] =~ /^\d+\.\d+\.[\w.]+$/)) { |
|
$remotelcrev = shift(@all_host_ids); |
|
} |
$ChildHost{$hostname}++; |
$ChildHost{$hostname}++; |
if ($ChildHost{$hostname} == 1) { |
if ($ChildHost{$hostname} == 1) { |
&CreateChild($hostname,$lonid,$all_host_ids[-1]); |
&CreateChild($hostname,$lonid,$all_host_ids[-1],$remotelcrev); |
} else { |
} else { |
&Log('WARNING',"Request for a second child on $hostname"); |
&Log('WARNING',"Request for a second child on $hostname"); |
} |
} |