Lines 64-70
my $op = $input->param('op');
Link Here
|
64 |
my $booksellerid = $input->param('booksellerid'); |
64 |
my $booksellerid = $input->param('booksellerid'); |
65 |
my $basketno = $input->param('basketno'); |
65 |
my $basketno = $input->param('basketno'); |
66 |
my $noconnection; |
66 |
my $noconnection; |
67 |
my $numberpending; |
|
|
68 |
my $attr = ''; |
67 |
my $attr = ''; |
69 |
my $term; |
68 |
my $term; |
70 |
my $host; |
69 |
my $host; |
Lines 88-94
unless ($random)
Link Here
|
88 |
$random = rand(1000000000); |
87 |
$random = rand(1000000000); |
89 |
} |
88 |
} |
90 |
|
89 |
|
91 |
my $DEBUG = 0; # if set to 1, many debug message are send on syslog. |
90 |
my $DEBUG = $ENV{DEBUG} || 0; # if set to 1, many debug message are send on syslog. |
92 |
|
91 |
|
93 |
# get framework list |
92 |
# get framework list |
94 |
my $frameworks = getframeworks; |
93 |
my $frameworks = getframeworks; |
Lines 131-141
if ( $op ne "do_search" ) {
Link Here
|
131 |
biblionumber => $biblionumber, |
130 |
biblionumber => $biblionumber, |
132 |
); |
131 |
); |
133 |
output_html_with_http_headers $input, $cookie, $template->output; |
132 |
output_html_with_http_headers $input, $cookie, $template->output; |
|
|
133 |
exit; |
134 |
} |
134 |
} |
135 |
else { |
135 |
|
136 |
my @id = $input->param('id'); |
136 |
my @id = $input->param('id'); |
137 |
|
137 |
|
138 |
if ( not defined @id ) { |
138 |
if ( not @id ) { |
139 |
# empty server list -> report and exit |
139 |
# empty server list -> report and exit |
140 |
$template->param( emptyserverlist => 1 ); |
140 |
$template->param( emptyserverlist => 1 ); |
141 |
output_html_with_http_headers $input, $cookie, $template->output; |
141 |
output_html_with_http_headers $input, $cookie, $template->output; |
Lines 228-234
warn "query ".$query if $DEBUG;
Link Here
|
228 |
# $oResult[$z] = $oConnection[$z]->search_pqf($query); |
228 |
# $oResult[$z] = $oConnection[$z]->search_pqf($query); |
229 |
} |
229 |
} |
230 |
|
230 |
|
231 |
sub displayresults { |
231 |
warn "# nremaining = $nremaining\n" if $DEBUG; |
|
|
232 |
|
233 |
while ( $nremaining-- ) { |
234 |
|
232 |
my $k; |
235 |
my $k; |
233 |
my $event; |
236 |
my $event; |
234 |
while ( ( $k = ZOOM::event( \@oConnection ) ) != 0 ) { |
237 |
while ( ( $k = ZOOM::event( \@oConnection ) ) != 0 ) { |
Lines 241-247
sub displayresults {
Link Here
|
241 |
|
244 |
|
242 |
if ( $k != 0 ) { |
245 |
if ( $k != 0 ) { |
243 |
$k--; |
246 |
$k--; |
244 |
warn $serverhost[$k] if $DEBUG; |
247 |
warn "event from $k server = ",$serverhost[$k] if $DEBUG; |
245 |
my ( $error, $errmsg, $addinfo, $diagset ) = |
248 |
my ( $error, $errmsg, $addinfo, $diagset ) = |
246 |
$oConnection[$k]->error_x(); |
249 |
$oConnection[$k]->error_x(); |
247 |
if ($error) { |
250 |
if ($error) { |
Lines 252-257
sub displayresults {
Link Here
|
252 |
} |
255 |
} |
253 |
else { |
256 |
else { |
254 |
my $numresults = $oResult[$k]->size(); |
257 |
my $numresults = $oResult[$k]->size(); |
|
|
258 |
warn "numresults = $numresults" if $DEBUG; |
255 |
my $i; |
259 |
my $i; |
256 |
my $result = ''; |
260 |
my $result = ''; |
257 |
if ( $numresults > 0 ) { |
261 |
if ( $numresults > 0 ) { |
Lines 305-324
sub displayresults {
Link Here
|
305 |
} #$numresults |
309 |
} #$numresults |
306 |
} |
310 |
} |
307 |
} # if $k !=0 |
311 |
} # if $k !=0 |
308 |
$numberpending = $nremaining - 1; |
|
|
309 |
$template->param( |
310 |
breeding_loop => \@breeding_loop, |
311 |
server => $servername[$k], |
312 |
numberpending => $numberpending, |
313 |
errconn => \@errconn |
314 |
); |
315 |
output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0; |
316 |
|
317 |
# print $template->output if $firstresult !=1; |
312 |
# print $template->output if $firstresult !=1; |
318 |
$firstresult++; |
313 |
$firstresult++; |
319 |
} |
314 |
|
320 |
displayresults(); |
315 |
} # while nremaining |
321 |
while ( --$nremaining > 0 ) { |
316 |
|
322 |
displayresults(); |
317 |
$template->param( |
323 |
} |
318 |
breeding_loop => \@breeding_loop, |
324 |
} ## if op=search |
319 |
#server => $servername[$k], |
|
|
320 |
numberpending => $nremaining > 0 ? $nremaining : 0, |
321 |
errconn => \@errconn |
322 |
); |
323 |
output_html_with_http_headers $input, $cookie, $template->output; |
324 |
|
325 |
- |
|
|