14 |
|
|
15 |
my $debug = 0; |
my $debug = 0; |
16 |
|
|
17 |
my $meteor_server = '192.168.1.13:4671'; |
my $tags_data; |
18 |
|
my $tags_security; |
19 |
|
my $visible_tags; |
20 |
|
|
21 |
|
my $meteor_server; # = '192.168.1.13:4671'; |
22 |
my $meteor_fh; |
my $meteor_fh; |
23 |
|
|
24 |
sub meteor { |
sub meteor { |
100 |
warn "WEB >> $path" if $debug; |
warn "WEB >> $path" if $debug; |
101 |
} elsif ( $method =~ m{/scan} ) { |
} elsif ( $method =~ m{/scan} ) { |
102 |
my $tags = scan_for_tags(); |
my $tags = scan_for_tags(); |
103 |
my $json = {}; |
my $json = { time => time() }; |
104 |
map { |
map { |
105 |
my $d = decode_tag($_); |
my $d = decode_tag($_); |
106 |
$d->{sid} = $_; |
$d->{sid} = $_; |
107 |
|
$d->{security} = $tags_security->{$_}; |
108 |
push @{ $json->{tags} }, $d; |
push @{ $json->{tags} }, $d; |
109 |
} keys %$tags; |
} keys %$tags; |
110 |
print $client "HTTP/1.0 200 OK\r\nContent-Type: application/x-javascript\r\n\r\n", |
print $client "HTTP/1.0 200 OK\r\nContent-Type: application/x-javascript\r\n\r\n", |
210 |
|
|
211 |
=cut |
=cut |
212 |
|
|
|
my $tags_data; |
|
|
my $visible_tags; |
|
|
|
|
213 |
my $item_type = { |
my $item_type = { |
214 |
1 => 'Book', |
1 => 'Book', |
215 |
6 => 'CD/CD ROM', |
6 => 'CD/CD ROM', |
434 |
( $from_tag, $security ) = ( substr($rest,0,8), substr($rest,8,1) ); |
( $from_tag, $security ) = ( substr($rest,0,8), substr($rest,8,1) ); |
435 |
die "security from other tag: ",as_hex( $from_tag ) if $from_tag ne str2bytes( $tag ); |
die "security from other tag: ",as_hex( $from_tag ) if $from_tag ne str2bytes( $tag ); |
436 |
$security = as_hex( $security ); |
$security = as_hex( $security ); |
437 |
|
$tags_security->{$tag} = $security; |
438 |
warn "# SECURITY $tag = $security\n"; |
warn "# SECURITY $tag = $security\n"; |
439 |
} |
} |
440 |
); |
); |
660 |
warn "## DISPATCH payload to with rest", dump( $payload, $to, $rest ) if $debug; |
warn "## DISPATCH payload to with rest", dump( $payload, $to, $rest ) if $debug; |
661 |
$dispatch->{ $to }->( $rest ); |
$dispatch->{ $to }->( $rest ); |
662 |
} else { |
} else { |
663 |
print "NO DISPATCH for ",dump( $full ),"\n"; |
print "NO DISPATCH for ",as_hex( $full ),"\n"; |
664 |
} |
} |
665 |
|
|
666 |
return $data; |
return $data; |