----- Original Message -----
From: "Davide Libenzi" <[EMAIL PROTECTED]>
Newsgroups: saltstorm.xmail
Sent: Sunday, November 10, 2002 10:40 PM
Subject: [xmail] Re: how often does xmailserver resend when recievingMTA isdown?
>
> On Sun, 10 Nov 2002, Bill Healy wrote:
>
> >
> > Davide,
> >
> > I think you posted a table of retry values in the paste, can't that be
> > put into the docs and the link fixed to go to it?
>
> Can someone convert this *very complex* C source to Perl :
>
> ------------------------------------------------------------
>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main(int argc, char * argv[]) {
>
> unsigned t, i, n, tot, c;
>
> if (argc < 4) {
> printf("use: %s init_delay delay_incr num_retries\n", argv[0]);
> return 1;
> }
>
> t = atoi(argv[1]);
> i = atoi(argv[2]);
> n = atoi(argv[3]);
> tot = 0;
>
> for (c = 1; c <= n; c++) {
> printf("%02u\tsend-time = %-6u\tnext-try = %u\n", c, tot, t);
>
> tot += t;
> t += t / i;
> }
> return 0;
> }
>
> ------------------------------------------------------------
>
in perl, here you go;
------------------------------------------------------------
if ($#ARGV < 2) {
printf("use: %s init_delay delay_incr num_retries\n", $0);
exit 1;
}
my($c,$t,$i,$n,$tot);
$t = int $ARGV[0];
$i = int $ARGV[1];
$n = int $ARGV[2];
$tot = 0;
for ($c = 1; $c <= $n; $c++) {
printf("%02u\tsend-time = %-6u\tnext-try = %u\n", $c, $tot, $t);
$tot += $t;
$t += $t / $i;
}
exit 0;
-----------------------------------------------------------
Thomas Loo.
-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]