projects
/
simpleserver-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add shlibs:Depends SIM-14
[simpleserver-moved-to-github.git]
/
ztest.pl
diff --git
a/ztest.pl
b/ztest.pl
index
9ecb4d9
..
40a9101
100755
(executable)
--- a/
ztest.pl
+++ b/
ztest.pl
@@
-1,7
+1,7
@@
#!/usr/bin/perl -w
## This file is part of simpleserver
#!/usr/bin/perl -w
## This file is part of simpleserver
-## Copyright (C) 2000-2011 Index Data.
+## Copyright (C) 2000-2013 Index Data.
## All rights reserved.
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
## All rights reserved.
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
@@
-54,7
+54,7
@@
sub my_init_handler {
if (defined($args->{PASS}) && defined($args->{USER})) {
printf("Received USER/PASS=%s/%s\n", $args->{USER},$args->{PASS});
}
if (defined($args->{PASS}) && defined($args->{USER})) {
printf("Received USER/PASS=%s/%s\n", $args->{USER},$args->{PASS});
}
-
+
}
}
@@
-70,6
+70,7
@@
sub my_scan_handler {
my $term = $args->{TERM};
my $entries = [
{ TERM => 'Number 1',
my $term = $args->{TERM};
my $entries = [
{ TERM => 'Number 1',
+ DISPLAY_TERM => 'Number .1',
OCCURRENCE => 10 },
{ TERM => 'Number 2',
OCCURRENCE => 8 },
OCCURRENCE => 10 },
{ TERM => 'Number 2',
OCCURRENCE => 8 },
@@
-94,6
+95,7
@@
sub my_scan_handler {
$args->{ENTRIES} = $entries;
$args->{STATUS} = Net::Z3950::SimpleServer::ScanPartial;
print "Welcome to scan....\n";
$args->{ENTRIES} = $entries;
$args->{STATUS} = Net::Z3950::SimpleServer::ScanPartial;
print "Welcome to scan....\n";
+ $args->{EXTRA_RESPONSE_DATA} = '<scanextra>b</scanextra>';
print "You scanned for term '$term'\n";
}
print "You scanned for term '$term'\n";
}
@@
-101,7
+103,7
@@
sub my_scan_handler {
my $_fail_frequency = 0;
my $_counter = 0;
my $_fail_frequency = 0;
my $_counter = 0;
-sub my_search_handler {
+sub my_search_handler {
my $args = shift;
my $data = [{
my $args = shift;
my $data = [{
@@
-132,10
+134,13
@@
sub my_search_handler {
print "Setname : $set_id\n";
print " inputfacets:\n";
print Dumper($facets);
print "Setname : $set_id\n";
print " inputfacets:\n";
print Dumper($facets);
+ print " extra args:\n";
+ print Dumper($args->{EXTRA_ARGS});
print "------------------------------------------------------------\n";
$args->{OUTPUTFACETS} = $facets;
print "------------------------------------------------------------\n";
$args->{OUTPUTFACETS} = $facets;
+ $args->{EXTRA_RESPONSE_DATA} = '<searchextra>b</searchextra>';
$args->{HITS} = $hits;
$session->{$set_id} = $data;
$session->{__HITS} = $hits;
$args->{HITS} = $hits;
$session->{$set_id} = $data;
$session->{__HITS} = $hits;
@@
-169,9
+174,15
@@
sub my_fetch_handler {
}
}
}
}
+sub my_start_handler {
+ my $args = shift;
+ my $config = $args->{CONFIG};
+}
+
Net::Z3950::SimpleServer::yazlog("hello");
Net::Z3950::SimpleServer::yazlog("hello");
-my $handler = new Net::Z3950::SimpleServer(
+my $handler = new Net::Z3950::SimpleServer(
+ START => "main::my_start_handler",
INIT => "main::my_init_handler",
SEARCH => "main::my_search_handler",
SCAN => "main::my_scan_handler",
INIT => "main::my_init_handler",
SEARCH => "main::my_search_handler",
SCAN => "main::my_scan_handler",