Skip to content

Commit

Permalink
bug 2164 - allows URL's only at end of cmd-line params
Browse files Browse the repository at this point in the history
Change-Id: Ib632c5199bf952bd5ee92ba518efc83d31e95d16
  • Loading branch information
steveyen committed Aug 27, 2010
1 parent d660e9b commit 8a4290e
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions memcached.c
Expand Up @@ -4759,26 +4759,23 @@ int main (int argc, char **argv) {
free(cproxy_cfg);
} else {
int i = argc - 1;
while (i > 0) {
if (strncmp(argv[i], "apikey=", 7) == 0 ||
strncmp(argv[i], "http://", 7) == 0 ||
strchr(argv[i], '@') != NULL) {
cproxy_init(argv[i], cproxy_behavior,
settings.num_threads,
main_base);
break;
}
i--;
}
if (i > 0 &&
(strncmp(argv[i], "apikey=", 7) == 0 ||
strncmp(argv[i], "http://", 7) == 0 ||
strchr(argv[i], '@') != NULL)) {
cproxy_init(argv[i], cproxy_behavior,
settings.num_threads,
main_base);
} else {
#ifndef MAIN_CHECK
if (i <= 0
&& settings.port == UNSPECIFIED
&& settings.udpport == UNSPECIFIED) {
moxi_log_write("ERROR: need proxy configuration. See usage (-h).\n");
if (ml->log_mode != ERRORLOG_STDERR) {
fprintf(stderr, "ERROR: need proxy configuration. See usage (-h).\n");
if (settings.port == UNSPECIFIED &&
settings.udpport == UNSPECIFIED) {
moxi_log_write("ERROR: need proxy configuration. See usage (-h).\n");
if (ml->log_mode != ERRORLOG_STDERR) {
fprintf(stderr, "ERROR: need proxy configuration. See usage (-h).\n");
}
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
#endif
}
Expand Down

0 comments on commit 8a4290e

Please sign in to comment.