make things appear
[spider.git] / perl / Aranea.pm
index fc77cc13122fe6f1a7f330c11992e5aedb1ac59f..7f0134c33e32bb0b8061d18684245b514d51f6a4 100644 (file)
@@ -28,10 +28,8 @@ use Thingy;
 use RouteDB;
 
 use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /^\d+\.\d+(?:\.(\d+)\.(\d+))?$/  || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$);
 
 use vars qw(@ISA $ntpflag $dupeage);
 
@@ -208,6 +206,7 @@ sub genheader
        my $date = ((($dayno << 1) | $ntpflag) << 18) |  ($main::systime % 86400);
        my $r = "$mycall," . sprintf('%6X%04X,0', $date, $seqno);
        $r .= ",$to" if $to;
+       $r .= "," if $from && !$to;
        $r .= ",$from" if $from;
        $seqno++;
        $seqno = 0 if $seqno > 0x0ffff;
@@ -327,15 +326,17 @@ sub input
                $thing->{user} = $user if $user;
                $thing->{hopsaway} = $hop; 
 
-               for (split(/,/, $rdata)) {
-                       if (/=/) {
-                               my ($k,$v) = split /=/, $_, 2;
-                               $thing->{$k} = tdecode($v);
-                       } else {
-                               $thing->{$_} = 1;
+               if ($rdata) {
+                       for (split(/,/, $rdata)) {
+                               if (/=/) {
+                                       my ($k,$v) = split /=/, $_, 2;
+                                       $thing->{$k} = tdecode($v);
+                               } else {
+                                       $thing->{$_} = 1;
+                               }
                        }
                }
-
+               
                # post process the thing, this generally adds on semantic meaning
                # does parameter checking etc. It also adds / prepares the thingy so
                # this is compatible with older protocol and arranges data so