Commit 2de15c8c authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Wash & cleaning of the -h and -s argument handling.

No functional changes.

Add ARGV_ERR() macro for reporting argument trouble.

Do selection of method in varnishd.c, using generic choice function.

Split subarguments into argc+argv at commans, and pass those down to
avoid repetitive and bogus string munging.

Catch more error conditions with respect to subarguments.

Add mini_obj magics to stevedores and slingers.

Generally tidy up along the way.


git-svn-id: http://www.varnish-cache.org/svn/trunk@2955 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 4a6ceb48
...@@ -464,7 +464,7 @@ void HSH_Prealloc(struct sess *sp); ...@@ -464,7 +464,7 @@ void HSH_Prealloc(struct sess *sp);
int HSH_Compare(const struct sess *sp, const struct objhead *o); int HSH_Compare(const struct sess *sp, const struct objhead *o);
void HSH_Copy(const struct sess *sp, const struct objhead *o); void HSH_Copy(const struct sess *sp, const struct objhead *o);
struct object *HSH_Lookup(struct sess *sp); struct object *HSH_Lookup(struct sess *sp);
void HSH_Unbusy(struct sess *sp); void HSH_Unbusy(const struct sess *sp);
void HSH_Ref(struct object *o); void HSH_Ref(struct object *o);
void HSH_Deref(struct object *o); void HSH_Deref(struct object *o);
double HSH_Grace(double g); double HSH_Grace(double g);
......
...@@ -302,7 +302,7 @@ hsh_rush(struct objhead *oh) ...@@ -302,7 +302,7 @@ hsh_rush(struct objhead *oh)
} }
void void
HSH_Unbusy(struct sess *sp) HSH_Unbusy(const struct sess *sp)
{ {
struct object *o; struct object *o;
struct objhead *oh; struct objhead *oh;
......
...@@ -58,3 +58,9 @@ int TCP_connect(int s, const struct sockaddr *name, socklen_t namelen, int msec) ...@@ -58,3 +58,9 @@ int TCP_connect(int s, const struct sockaddr *name, socklen_t namelen, int msec)
/* Really belongs in mgt.h, but storage_file chokes on both */ /* Really belongs in mgt.h, but storage_file chokes on both */
void mgt_child_inherit(int fd, const char *what); void mgt_child_inherit(int fd, const char *what);
#define ARGV_ERR(...) \
do { \
fprintf(stderr, "Error: " __VA_ARGS__); \
exit(2); \
} while (0);
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
-emacro(827, assert) // loop not reachable -emacro(827, assert) // loop not reachable
-emacro(774, assert) // booelan always true -emacro(774, assert) // booelan always true
-emacro(774, HTTPH) // always false -emacro(774, HTTPH) // always false
-emacro(527, ARGV_ERR) // unreachable
// cache.h // cache.h
-emacro(506, INCOMPL) // Constant value Boolean -emacro(506, INCOMPL) // Constant value Boolean
......
...@@ -68,15 +68,19 @@ static struct hcl_hd *hcl_head; ...@@ -68,15 +68,19 @@ static struct hcl_hd *hcl_head;
* The ->init method allows the management process to pass arguments * The ->init method allows the management process to pass arguments
*/ */
static int static void
hcl_init(const char *p) hcl_init(int ac, char * const *av)
{ {
int i; int i;
unsigned u; unsigned u;
i = sscanf(p, "%u", &u); if (ac == 0)
return;
if (ac > 1)
ARGV_ERR("(-hclassic) too many arguments\n");
i = sscanf(av[0], "%u", &u);
if (i <= 0 || u == 0) if (i <= 0 || u == 0)
return (0); return;
if (u > 2 && !(u & (u - 1))) { if (u > 2 && !(u & (u - 1))) {
fprintf(stderr, fprintf(stderr,
"NOTE:\n" "NOTE:\n"
...@@ -88,7 +92,7 @@ hcl_init(const char *p) ...@@ -88,7 +92,7 @@ hcl_init(const char *p)
} }
hcl_nhash = u; hcl_nhash = u;
fprintf(stderr, "Classic hash: %u buckets\n", hcl_nhash); fprintf(stderr, "Classic hash: %u buckets\n", hcl_nhash);
return (0); return;
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -245,9 +249,10 @@ hcl_deref(const struct objhead *oh) ...@@ -245,9 +249,10 @@ hcl_deref(const struct objhead *oh)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
struct hash_slinger hcl_slinger = { struct hash_slinger hcl_slinger = {
"classic", .magic = SLINGER_MAGIC,
hcl_init, .name = "classic",
hcl_start, .init = hcl_init,
hcl_lookup, .start = hcl_start,
hcl_deref, .lookup = hcl_lookup,
.deref = hcl_deref,
}; };
...@@ -139,9 +139,9 @@ hsl_deref(const struct objhead *obj) ...@@ -139,9 +139,9 @@ hsl_deref(const struct objhead *obj)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
struct hash_slinger hsl_slinger = { struct hash_slinger hsl_slinger = {
"simple_list", .magic = SLINGER_MAGIC,
NULL, .name = "simple",
hsl_start, .start = hsl_start,
hsl_lookup, .lookup = hsl_lookup,
hsl_deref, .deref = hsl_deref,
}; };
...@@ -31,12 +31,14 @@ ...@@ -31,12 +31,14 @@
struct sess; struct sess;
typedef int hash_init_f(const char *); typedef void hash_init_f(int ac, char * const *av);
typedef void hash_start_f(void); typedef void hash_start_f(void);
typedef struct objhead *hash_lookup_f(const struct sess *sp, struct objhead *nobj); typedef struct objhead *hash_lookup_f(const struct sess *sp, struct objhead *nobj);
typedef int hash_deref_f(const struct objhead *obj); typedef int hash_deref_f(const struct objhead *obj);
struct hash_slinger { struct hash_slinger {
unsigned magic;
#define SLINGER_MAGIC 0x1b720cba
const char *name; const char *name;
hash_init_f *init; hash_init_f *init;
hash_start_f *start; hash_start_f *start;
......
...@@ -63,10 +63,6 @@ int mgt_push_vcls_and_start(unsigned *status, char **p); ...@@ -63,10 +63,6 @@ int mgt_push_vcls_and_start(unsigned *status, char **p);
int mgt_has_vcl(void); int mgt_has_vcl(void);
extern char *mgt_cc_cmd; extern char *mgt_cc_cmd;
#include "hash_slinger.h"
extern struct hash_slinger hsl_slinger;
extern struct hash_slinger hcl_slinger;
#define REPORT0(pri, fmt) \ #define REPORT0(pri, fmt) \
do { \ do { \
......
...@@ -37,9 +37,6 @@ ...@@ -37,9 +37,6 @@
#include "cache.h" #include "cache.h"
#include "stevedore.h" #include "stevedore.h"
extern struct stevedore sma_stevedore;
extern struct stevedore smf_stevedore;
static VTAILQ_HEAD(, stevedore) stevedores = static VTAILQ_HEAD(, stevedore) stevedores =
VTAILQ_HEAD_INITIALIZER(stevedores); VTAILQ_HEAD_INITIALIZER(stevedores);
...@@ -95,47 +92,21 @@ STV_free(const struct storage *st) ...@@ -95,47 +92,21 @@ STV_free(const struct storage *st)
st->stevedore->free(st); st->stevedore->free(st);
} }
static int
cmp_storage(const struct stevedore *s, const char *p, const char *q)
{
unsigned u;
u = pdiff(p, q);
if (strlen(s->name) != u)
return (1);
if (strncmp(s->name, p, u))
return (1);
return (0);
}
void void
STV_add(const char *spec) STV_add(const struct stevedore *stv2, int ac, char * const *av)
{ {
const char *p, *q;
struct stevedore *stv; struct stevedore *stv;
p = strchr(spec, ','); CHECK_OBJ_NOTNULL(stv2, STEVEDORE_MAGIC);
if (p == NULL) ALLOC_OBJ(stv, STEVEDORE_MAGIC);
q = p = strchr(spec, '\0');
else
q = p + 1;
xxxassert(p != NULL);
xxxassert(q != NULL);
stv = malloc(sizeof *stv);
AN(stv); AN(stv);
if (!cmp_storage(&sma_stevedore, spec, p)) { *stv = *stv2;
*stv = sma_stevedore;
} else if (!cmp_storage(&smf_stevedore, spec, p)) {
*stv = smf_stevedore;
} else {
fprintf(stderr, "Unknown storage method \"%.*s\"\n",
(int)(p - spec), spec);
exit (2);
}
if (stv->init != NULL) if (stv->init != NULL)
stv->init(stv, q); stv->init(stv, ac, av);
else if (ac != 0)
ARGV_ERR("(-s%s) too many arguments\n", stv->name);
VTAILQ_INSERT_TAIL(&stevedores, stv, list); VTAILQ_INSERT_TAIL(&stevedores, stv, list);
......
...@@ -35,13 +35,15 @@ struct stevedore; ...@@ -35,13 +35,15 @@ struct stevedore;
struct sess; struct sess;
struct iovec; struct iovec;
typedef void storage_init_f(struct stevedore *, const char *spec); typedef void storage_init_f(struct stevedore *, int ac, char * const *av);
typedef void storage_open_f(const struct stevedore *); typedef void storage_open_f(const struct stevedore *);
typedef struct storage *storage_alloc_f(struct stevedore *, size_t size); typedef struct storage *storage_alloc_f(struct stevedore *, size_t size);
typedef void storage_trim_f(const struct storage *, size_t size); typedef void storage_trim_f(const struct storage *, size_t size);
typedef void storage_free_f(const struct storage *); typedef void storage_free_f(const struct storage *);
struct stevedore { struct stevedore {
unsigned magic;
#define STEVEDORE_MAGIC 0x4baf43db
const char *name; const char *name;
storage_init_f *init; /* called by mgt process */ storage_init_f *init; /* called by mgt process */
storage_open_f *open; /* called by cache process */ storage_open_f *open; /* called by cache process */
...@@ -58,5 +60,5 @@ struct stevedore { ...@@ -58,5 +60,5 @@ struct stevedore {
struct storage *STV_alloc(struct sess *sp, size_t size); struct storage *STV_alloc(struct sess *sp, size_t size);
void STV_trim(const struct storage *st, size_t size); void STV_trim(const struct storage *st, size_t size);
void STV_free(const struct storage *st); void STV_free(const struct storage *st);
void STV_add(const char *spec); void STV_add(const struct stevedore *stv, int ac, char * const *av);
void STV_open(void); void STV_open(void);
...@@ -108,7 +108,7 @@ struct smf { ...@@ -108,7 +108,7 @@ struct smf {
}; };
struct smf_sc { struct smf_sc {
char *filename; const char *filename;
int fd; int fd;
unsigned pagesize; unsigned pagesize;
uintmax_t filesize; uintmax_t filesize;
...@@ -172,11 +172,8 @@ smf_calcsize(struct smf_sc *sc, const char *size, int newfile) ...@@ -172,11 +172,8 @@ smf_calcsize(struct smf_sc *sc, const char *size, int newfile)
} else { } else {
q = str2bytes(size, &l, fssize); q = str2bytes(size, &l, fssize);
if (q != NULL) { if (q != NULL)
fprintf(stderr, ARGV_ERR("(-sfile) size \"%s\": %s\n", size, q);
"Error: (-sfile) size \"%s\": %s\n", size, q);
exit (2);
}
} }
/* /*
...@@ -206,12 +203,9 @@ smf_calcsize(struct smf_sc *sc, const char *size, int newfile) ...@@ -206,12 +203,9 @@ smf_calcsize(struct smf_sc *sc, const char *size, int newfile)
/* round down to multiple of filesystem blocksize or pagesize */ /* round down to multiple of filesystem blocksize or pagesize */
l -= (l % bs); l -= (l % bs);
if (l < MINPAGES * (uintmax_t)sc->pagesize) { if (l < MINPAGES * (uintmax_t)sc->pagesize)
fprintf(stderr, ARGV_ERR("size too small, at least %ju needed\n",
"Error: size too small, at least %ju needed\n",
(uintmax_t)MINPAGES * sc->pagesize); (uintmax_t)MINPAGES * sc->pagesize);
exit (2);
}
if (sizeof(void *) == 4 && l > INT32_MAX) { /*lint !e506 !e774 */ if (sizeof(void *) == 4 && l > INT32_MAX) { /*lint !e506 !e774 */
fprintf(stderr, fprintf(stderr,
...@@ -238,15 +232,33 @@ smf_initfile(struct smf_sc *sc, const char *size, int newfile) ...@@ -238,15 +232,33 @@ smf_initfile(struct smf_sc *sc, const char *size, int newfile)
/* XXX: force block allocation here or in open ? */ /* XXX: force block allocation here or in open ? */
} }
static char default_size[] = "50%";
static char default_filename[] = ".";
static void static void
smf_init(struct stevedore *parent, const char *spec) smf_init(struct stevedore *parent, int ac, char * const *av)
{ {
char *size; const char *size, *fn;
char *p, *q; char *q, *p;
struct stat st; struct stat st;
struct smf_sc *sc; struct smf_sc *sc;
unsigned u; unsigned u;
AZ(av[ac]);
fn = default_filename;
size = default_size;
if (ac > 2)
ARGV_ERR("(-sfile) too many arguments\n");
if (ac > 0 && *av[0] != '\0')
fn = av[0];
if (ac > 1 && *av[1] != '\0')
size = av[1];
AN(fn);
AN(size);
sc = calloc(sizeof *sc, 1); sc = calloc(sizeof *sc, 1);
XXXAN(sc); XXXAN(sc);
VTAILQ_INIT(&sc->order); VTAILQ_INIT(&sc->order);
...@@ -257,82 +269,52 @@ smf_init(struct stevedore *parent, const char *spec) ...@@ -257,82 +269,52 @@ smf_init(struct stevedore *parent, const char *spec)
parent->priv = sc; parent->priv = sc;
/* If no size specified, use 50% of filesystem free space */
if (spec == NULL || *spec == '\0')
asprintf(&p, ".,50%%");
else if (strchr(spec, ',') == NULL)
asprintf(&p, "%s,", spec);
else
p = strdup(spec);
XXXAN(p);
size = strchr(p, ',');
XXXAN(size);
*size++ = '\0';
/* try to create a new file of this name */ /* try to create a new file of this name */
sc->fd = open(p, O_RDWR | O_CREAT | O_EXCL, 0600); sc->fd = open(fn, O_RDWR | O_CREAT | O_EXCL, 0600);
if (sc->fd >= 0) { if (sc->fd >= 0) {
sc->filename = p; sc->filename = fn;
mgt_child_inherit(sc->fd, "storage_file"); mgt_child_inherit(sc->fd, "storage_file");
smf_initfile(sc, size, 1); smf_initfile(sc, size, 1);
return; return;
} }
/* it must exist then */ /* it must exist then */
if (stat(p, &st)) { if (stat(fn, &st))
fprintf(stderr, ARGV_ERR("(-sfile) \"%s\" "
"Error: (-sfile) \"%s\" " "does not exist and could not be created\n", fn);
"does not exist and could not be created\n", p);
exit (2);
}
/* and it should be a file or directory */ /* and it should be a file or directory */
if (!(S_ISREG(st.st_mode) || S_ISDIR(st.st_mode))) { if (!(S_ISREG(st.st_mode) || S_ISDIR(st.st_mode)))
fprintf(stderr, ARGV_ERR("(-sfile) \"%s\" is neither file nor directory\n", fn);
"Error: (-sfile) \"%s\" "
"is neither file nor directory\n", p);
exit (2);
}
if (S_ISREG(st.st_mode)) { if (S_ISREG(st.st_mode)) {
sc->fd = open(p, O_RDWR); sc->fd = open(fn, O_RDWR);
if (sc->fd < 0) { if (sc->fd < 0)
fprintf(stderr, ARGV_ERR("(-sfile) \"%s\" could not open (%s)\n",
"Error: (-sfile) \"%s\" " fn, strerror(errno));
"could not open (%s)\n", p, strerror(errno));
exit (2);
}
AZ(fstat(sc->fd, &st)); AZ(fstat(sc->fd, &st));
if (!S_ISREG(st.st_mode)) { if (!S_ISREG(st.st_mode))
fprintf(stderr, ARGV_ERR("(-sfile) \"%s\" "
"Error: (-sfile) \"%s\" " "was not a file after opening\n", fn);
"was not a file after opening\n", p); sc->filename = fn;
exit (2);
}
sc->filename = p;
mgt_child_inherit(sc->fd, "storage_file"); mgt_child_inherit(sc->fd, "storage_file");
smf_initfile(sc, size, 0); smf_initfile(sc, size, 0);
return; return;
} }
asprintf(&q, "%s/varnish.XXXXXX", fn);
asprintf(&q, "%s/varnish.XXXXXX", p);
XXXAN(q); XXXAN(q);
sc->fd = mkstemp(q); sc->fd = mkstemp(q);
if (sc->fd < 0) { if (sc->fd < 0)
fprintf(stderr, ARGV_ERR("(-sfile) \"%s\" "
"Error: (-sfile) \"%s\" " "mkstemp(%s) failed (%s)\n", fn, q, strerror(errno));
"mkstemp(%s) failed (%s)\n", p, q, strerror(errno));
exit (2);
}
AZ(unlink(q)); AZ(unlink(q));
asprintf(&sc->filename, "%s (unlinked)", q); asprintf(&p, "%s (unlinked)", q);
XXXAN(sc->filename); XXXAN(p);
sc->filename = p;
free(q); free(q);
smf_initfile(sc, size, 1); smf_initfile(sc, size, 1);
mgt_child_inherit(sc->fd, "storage_file"); mgt_child_inherit(sc->fd, "storage_file");
free(p);
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -705,12 +687,13 @@ smf_free(const struct storage *s) ...@@ -705,12 +687,13 @@ smf_free(const struct storage *s)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
struct stevedore smf_stevedore = { struct stevedore smf_stevedore = {
.name = "file", .magic = STEVEDORE_MAGIC,
.init = smf_init, .name = "file",
.open = smf_open, .init = smf_init,
.alloc = smf_alloc, .open = smf_open,
.trim = smf_trim, .alloc = smf_alloc,
.free = smf_free, .trim = smf_trim,
.free = smf_free,
}; };
#ifdef INCLUDE_TEST_DRIVER #ifdef INCLUDE_TEST_DRIVER
......
...@@ -123,26 +123,26 @@ sma_trim(const struct storage *s, size_t size) ...@@ -123,26 +123,26 @@ sma_trim(const struct storage *s, size_t size)
} }
static void static void
sma_init(struct stevedore *parent, const char *spec) sma_init(struct stevedore *parent, int ac, char * const *av)
{ {
const char *e; const char *e;
uintmax_t u; uintmax_t u;
(void)parent; (void)parent;
if (spec != NULL && *spec != '\0') {
e = str2bytes(spec, &u, 0); AZ(av[ac]);
if (e != NULL) { if (ac > 1)
fprintf(stderr, ARGV_ERR("(-smalloc) too many arguments\n");
"Error: (-smalloc) size \"%s\": %s\n", spec, e);
exit(2); if (ac == 0 || *av[0] == '\0')
} return;
if ((u != (uintmax_t)(size_t)u)) {
fprintf(stderr, e = str2bytes(av[0], &u, 0);
"Error: (-smalloc) size \"%s\": too big\n", spec); if (e != NULL)
exit(2); ARGV_ERR("(-smalloc) size \"%s\": %s\n", av[0], e);
} if ((u != (uintmax_t)(size_t)u))
sma_max = u; ARGV_ERR("(-smalloc) size \"%s\": too big\n", av[0]);
} sma_max = u;
} }
static void static void
...@@ -153,10 +153,11 @@ sma_open(const struct stevedore *st) ...@@ -153,10 +153,11 @@ sma_open(const struct stevedore *st)
} }
struct stevedore sma_stevedore = { struct stevedore sma_stevedore = {
.name = "malloc", .magic = STEVEDORE_MAGIC,
.init = sma_init, .name = "malloc",
.open = sma_open, .init = sma_init,
.alloc = sma_alloc, .open = sma_open,
.free = sma_free, .alloc = sma_alloc,
.trim = sma_trim, .free = sma_free,
.trim = sma_trim,
}; };
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include "shmlog.h" #include "shmlog.h"
#include "heritage.h" #include "heritage.h"
#include "mgt.h" #include "mgt.h"
#include "hash_slinger.h"
#include "stevedore.h" #include "stevedore.h"
/* INFTIM indicates an infinite timeout for poll(2) */ /* INFTIM indicates an infinite timeout for poll(2) */
...@@ -79,47 +80,97 @@ volatile struct params *params; ...@@ -79,47 +80,97 @@ volatile struct params *params;
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static int struct choice {
cmp_hash(const struct hash_slinger *s, const char *p, const char *q) const char *name;
void *ptr;
};
static void *
pick(const struct choice *cp, const char *which, const char *kind)
{ {
if (strlen(s->name) != (q - p))
return (1); for(; cp->name != NULL; cp++) {
if (strncmp(s->name, p, (q - p))) if (!strcmp(cp->name, which))
return (1); return (cp->ptr);
return (0); }
ARGV_ERR("Unknown %s method \"%s\"\n", kind, which);
} }
/*--------------------------------------------------------------------*/
extern struct stevedore sma_stevedore;
extern struct stevedore smf_stevedore;
static struct choice stv_choice[] = {
{ "file", &smf_stevedore },
{ "malloc", &sma_stevedore },
{ NULL, NULL }
};
static void static void
setup_hash(const char *s_arg) setup_storage(const char *spec)
{ {
const char *p, *q; char **av;
void *priv;
int ac;
av = ParseArgv(spec, ARGV_COMMA);
if (av[0] != NULL)
ARGV_ERR("%s\n", av[0]);
if (av[1] == NULL)
ARGV_ERR("-s argument is empty\n");
for (ac = 0; av[ac + 2] != NULL; ac++)
continue;
priv = pick(stv_choice, av[1], "storage");
AN(priv);
STV_add(priv, ac, av + 2);
/* We do not free av, to make life simpler for stevedores */
}
/*--------------------------------------------------------------------*/
extern struct hash_slinger hsl_slinger;
extern struct hash_slinger hcl_slinger;
static struct choice hsh_choice[] = {
{ "classic", &hcl_slinger },
{ "simple", &hsl_slinger },
{ "simple_list", &hsl_slinger }, /* backwards compat */
{ NULL, NULL }
};
static void
setup_hash(const char *h_arg)
{
char **av;
int ac;
struct hash_slinger *hp; struct hash_slinger *hp;
p = strchr(s_arg, ','); av = ParseArgv(h_arg, ARGV_COMMA);
if (p == NULL)
q = p = strchr(s_arg, '\0'); if (av[0] != NULL)
else ARGV_ERR("%s\n", av[0]);
q = p + 1;
xxxassert(p != NULL); if (av[1] == NULL)
xxxassert(q != NULL); ARGV_ERR("-h argument is empty\n");
if (!cmp_hash(&hcl_slinger, s_arg, p)) {
hp = &hcl_slinger; for (ac = 0; av[ac + 2] != NULL; ac++)
} else if (!cmp_hash(&hsl_slinger, s_arg, p)) { continue;
hp = &hsl_slinger;
} else { hp = pick(hsh_choice, av[1], "hash");
fprintf(stderr, "Unknown hash method \"%.*s\"\n", CHECK_OBJ_NOTNULL(hp, SLINGER_MAGIC);
(int)(p - s_arg), s_arg);
exit (2);
}
heritage.hash = hp; heritage.hash = hp;
if (hp->init != NULL) { if (hp->init != NULL)
if (hp->init(q)) hp->init(ac, av + 2);
exit (1); else if (ac > 0)
} else if (*q) { ARGV_ERR("Hash method \"%s\" takes no arguments\n",
fprintf(stderr, "Hash method \"%s\" takes no arguments\n",
hp->name); hp->name);
exit (1);
}
} }
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
...@@ -436,7 +487,7 @@ main(int argc, char *argv[]) ...@@ -436,7 +487,7 @@ main(int argc, char *argv[])
break; break;
case 's': case 's':
s_arg_given = 1; s_arg_given = 1;
STV_add(optarg); setup_storage(optarg);
break; break;
case 't': case 't':
MCF_ParamSet(cli, "default_ttl", optarg); MCF_ParamSet(cli, "default_ttl", optarg);
...@@ -538,7 +589,7 @@ main(int argc, char *argv[]) ...@@ -538,7 +589,7 @@ main(int argc, char *argv[])
exit (0); exit (0);
if (!s_arg_given) if (!s_arg_given)
STV_add(s_arg); setup_storage(s_arg);
setup_hash(h_arg); setup_hash(h_arg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment