--- loncom/LondConnection.pm 2006/01/27 20:37:12 1.39 +++ loncom/LondConnection.pm 2006/08/25 21:20:11 1.42 @@ -1,7 +1,7 @@ # This module defines and implements a class that represents # a connection to a lond daemon. # -# $Id: LondConnection.pm,v 1.39 2006/01/27 20:37:12 albertel Exp $ +# $Id: LondConnection.pm,v 1.42 2006/08/25 21:20:11 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -297,8 +297,7 @@ sub new { return undef; } - } - else { + } else { # Remote peer: I'd like to do ssl, but if my host key or certificates # are not all installed, my only choice is insecure, if that's # allowed: @@ -333,7 +332,6 @@ sub new { # # Set socket to nonblocking I/O. # - my $socket = $self->{Socket}; my $flags = fcntl($socket, F_GETFL,0); if(!$flags) { $socket->close; @@ -738,7 +736,7 @@ sub InitiateTransaction { # Setup the trasaction # currently no version of lond supports inlining the sethost - if ($self->PeerVersion() <= 10000000) { + if ($self->PeerVersion() <= 321) { if ($server ne $self->{LoncapaHim}) { $self->{NextRequest} = $data; $self->{TransactionRequest} = "$sethost:$server\n"; @@ -747,6 +745,7 @@ sub InitiateTransaction { $self->{TransactionRequest} = $data; } } else { + $self->{LoncapaHim} = $server; $self->{TransactionRequest} = "$sethost:$server:$data"; } $self->{TransactionReply} = ""; @@ -1146,7 +1145,7 @@ this iterator returns a reference to an information read from the hosts configuration file. Array elements are used as follows: - [0] - LonCapa host name. + [0] - LonCapa host id. [1] - LonCapa domain name. [2] - Loncapa role (e.g. library or access). [3] - DNS name server hostname. @@ -1257,8 +1256,8 @@ sub read_hosts { # sub PeerVersion { my $self = shift; - my ($version) = ($self->{LondVersion} =~ /Revision 1\.(\d+)/); - return $self->{LondVersion}; + my ($version) = ($self->{LondVersion} =~ /Revision: 1\.(\d+)/); + return $version; } 1;