#!/usr/bin/perl -w
-## $Id: ztest.pl,v 1.15 2006-04-19 13:17:52 sondberg Exp $
+## $Id: ztest.pl,v 1.16 2007-03-07 11:25:29 mike Exp $
## ------------------------------------------------------------------
##
## Copyright (c) 2000-2004, Index Data.
}
+my $_fail_frequency = 0;
+my $_counter = 0;
+
sub my_search_handler {
my $args = shift;
+
+ if ($_fail_frequency != 0 && ++$_counter % $_fail_frequency == 0) {
+ print "Exiting to be nasty to client\n";
+ exit(1);
+ }
my $data = [{
name => "Peter Dornan",
title => "Spokesman",
SORT => "main::my_sort_handler",
FETCH => "main::my_fetch_handler" );
+if (@ARGV >= 2 && $ARGV[0] eq "-n") {
+ $_fail_frequency = $ARGV[1];
+ shift;
+ shift;
+}
$handler->launch_server("ztest.pl", @ARGV);