aboutsummaryrefslogtreecommitdiff
path: root/src/piesctl.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-06-02 13:43:21 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-06-02 13:49:55 +0300
commit8004bbaa1b31b14dd4c4d3886b5f57b103bf7405 (patch)
treea6fd826c284fe1e7131c4852c2964b6029ca758d /src/piesctl.c
parent685600d72b0c300f94c0c69dc0a16c4ebb230a21 (diff)
downloadpies-8004bbaa1b31b14dd4c4d3886b5f57b103bf7405.tar.gz
pies-8004bbaa1b31b14dd4c4d3886b5f57b103bf7405.tar.bz2
Speed up tests.
Presence of the ~/.netrc file can slow down execution because of eventual DNS calls in hostcmp. Provide an option to disable netrc parsing and use it in tests. * src/piesctl-cl.opt: New option: --no-netrc. * doc/pies.texi: Document --no-netrc * src/piesctl.c (shttp_connect): Don't read ~/.netrc if given --no-netrc. * tests/env.at: Pass --no-netrc to piesctl. * tests/respawn.at: Likewise. * tests/shell.at: Likewise. * tests/shutdown.at: Likewise. * tests/startup.at: Likewise.
Diffstat (limited to 'src/piesctl.c')
-rw-r--r--src/piesctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/piesctl.c b/src/piesctl.c
index 0cd2736..4c777d7 100644
--- a/src/piesctl.c
+++ b/src/piesctl.c
@@ -46,12 +46,13 @@ struct client_conn
struct grecs_sockaddr *source_addr;
} client;
char const *instance = "pies";
char *config_file;
char default_config_file[] = SYSCONFDIR "/piesctl.conf";
int preprocess_only;
+int no_netrc_option;
int verbose;
int dump;
struct grecs_sockaddr_hints hints = { .flags = GRECS_AH_PASSIVE };
#define EX_OK 0
@@ -540,13 +541,14 @@ shttp_connect (struct pies_url *url, struct grecs_sockaddr *source_addr)
conn = grecs_zalloc (sizeof (*conn));
conn->fp = fp;
if (pies_url_copy (&conn->url, url))
grecs_alloc_die ();
- netrc_scan (conn->url);
+ if (!no_netrc_option)
+ netrc_scan (conn->url);
return conn;
}
static void
shttp_auth_free (struct shttp_connection *conn)

Return to:

Send suggestions and report system problems to the System administrator.