chiark
/
gitweb
/
~mdw
/
adns
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changes as from fanf in his message of 11th May 2000.
[adns]
/
client
/
adnslogres.c
diff --git
a/client/adnslogres.c
b/client/adnslogres.c
index f99f926137697985d939f471b1336bcdfd13bd72..f8df156b7f3b55ac2d06866e098408217aa93d41 100644
(file)
--- a/
client/adnslogres.c
+++ b/
client/adnslogres.c
@@
-4,12
+4,12
@@
*/
/*
* This file is
*/
/*
* This file is
- * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ * Copyright (C) 1999
-2000
Tony Finch <dot@dotat.at>
* Copyright (C) 1999-2000 Ian Jackson <ian@davenant.greenend.org.uk>
*
* It is part of adns, which is
* Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
* Copyright (C) 1999-2000 Ian Jackson <ian@davenant.greenend.org.uk>
*
* It is part of adns, which is
* Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
- * Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ * Copyright (C) 1999
-2000
Tony Finch <dot@dotat.at>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-31,7
+31,7
@@
*/
static const char * const cvsid =
*/
static const char * const cvsid =
- "$Id: adnslogres.c,v 1.1
2 2000/09/14 01:23:39
ian Exp $";
+ "$Id: adnslogres.c,v 1.1
3 2000/09/16 19:13:11
ian Exp $";
#include <sys/types.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/time.h>
@@
-48,7
+48,8
@@
static const char * const cvsid =
#include "adns.h"
/* maximum number of concurrent DNS queries */
#include "adns.h"
/* maximum number of concurrent DNS queries */
-#define MAXPENDING 1000
+#define MAXPENDING 64000
+#define MAXPENDING 64000
/* maximum length of a line */
#define MAXLINE 1024
/* maximum length of a line */
#define MAXLINE 1024
@@
-204,12
+205,13
@@
static void proclog(FILE *inf, FILE *outf, int opts) {
}
static void usage(void) {
}
static void usage(void) {
- fprintf(stderr, "usage: %s [-d] [-p] [logfile]\n", progname);
+ fprintf(stderr, "usage: %s [-d] [-p] [
-c concurrency] [
logfile]\n", progname);
exit(1);
}
int main(int argc, char *argv[]) {
exit(1);
}
int main(int argc, char *argv[]) {
- int c, opts;
+ int c, opts, maxpending;
+ extern char *optarg;
FILE *inf;
progname= strrchr(*argv, '/');
FILE *inf;
progname= strrchr(*argv, '/');
@@
-217,10
+219,18
@@
int main(int argc, char *argv[]) {
progname++;
else
progname= *argv;
progname++;
else
progname= *argv;
- opts= 0;
- while ((c= getopt(argc, argv, "dp")) != -1)
+ maxpending= MAXPENDING;
+ opts= 0;
+ while ((c= getopt(argc, argv, "c:dp")) != -1)
switch (c) {
switch (c) {
+ case 'c':
+ maxpending= atoi(optarg);
+ if (maxpending < 1 || maxpending > MAXPENDING) {
+ fprintf(stderr, "%s: unfeasible concurrency %d\n", progname, maxpending);
+ exit(1);
+ }
+ break;
case 'd':
opts|= OPT_DEBUG;
break;
case 'd':
opts|= OPT_DEBUG;
break;
@@
-245,7
+255,7
@@
int main(int argc, char *argv[]) {
if (!inf)
aargh("couldn't open input");
if (!inf)
aargh("couldn't open input");
- proclog(inf, stdout, opts);
+ proclog(inf, stdout,
maxpending,
opts);
if (fclose(inf))
aargh("fclose input");
if (fclose(inf))
aargh("fclose input");