From 18c0ebda0f4f4829438e44092e4a061ce483b839 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Tue, 13 Oct 2026 15:36:23 +0300 Subject: [PATCH] Remove dial on demand dialer ran a program when a name could not be resolved, for dial-up links; with nscache it did not even run. The command is still accepted and ignored, so configurations using it keep loading. Co-Authored-By: Claude Opus 5.5 --- man/3proxy.cfg.5 | 10 +++------- src/common.c | 7 ------- src/conf.c | 4 ++-- src/structures.h | 1 - tests/README.md | 2 +- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/man/3proxy.cfg.5 b/man/3proxy.cfg.5 index 1aefc3a..ba97060 100644 --- a/man/3proxy.cfg.5 +++ b/man/3proxy.cfg.5 @@ -579,9 +579,7 @@ for a record naming an IPv6 address - and \fBnserver\fR must be set as well: without it the system resolver is used and static records are never consulted. If 0.0.0.0 is used as a hostaddr host will never resolve, it can be used to -blacklist something or together with -.B dialer -command to set up UDL for dialing. +blacklist something. .br .B fakeresolve @@ -593,10 +591,8 @@ redirected to a parent proxy with \fBhttp\fR, \fBsocks4+\fR, \fBconnect+\fR or \ .BR dialer \fI\fR .br - Execute progname if external name can\'t be resolved. -Hint: if you use nscache, dialer may not work, because names will -be resolved through cache. In this case you can use something like -http://dial.right.now/ from browser to set up connection. + Ignored: dial on demand is no longer supported. The command is accepted so +that configurations using it still load. .br diff --git a/src/common.c b/src/common.c index a4e6757..0edf0ea 100644 --- a/src/common.c +++ b/src/common.c @@ -288,7 +288,6 @@ struct extparam conf = { .filters = NULL, .authfuncs = NULL, .stdlog = NULL, - .demanddialprog = NULL, .stringtable = NULL, .logtime = (time_t)0, .time = (time_t)0, @@ -956,8 +955,6 @@ uint32_t getip(unsigned char *name){ } } if((tmpresolv=resolvfunc)){ - if((*tmpresolv)(AF_INET, name, (unsigned char *)&retval)) return retval; - if(conf.demanddialprog) system(conf.demanddialprog); return (*tmpresolv)(AF_INET, name, (unsigned char *)&retval)?retval:0; } #ifndef NOSTDRESOLVE @@ -969,10 +966,6 @@ uint32_t getip(unsigned char *name){ _3proxy_mutex_lock(&gethostbyname_mutex); #endif hp=gethostbyname((char *)name); - if (!hp && conf.demanddialprog) { - system(conf.demanddialprog); - hp=gethostbyname((char *)name); - } retval = hp?*(uint32_t *)hp->h_addr:0; #if !defined(_WIN32) && !defined(GETHOSTBYNAME_R) _3proxy_mutex_unlock(&gethostbyname_mutex); diff --git a/src/conf.c b/src/conf.c index 3cb7860..7316194 100644 --- a/src/conf.c +++ b/src/conf.c @@ -757,9 +757,9 @@ static int h_nsrecord(int argc, unsigned char **argv){ return 0; } +/* dialer: running a program when a name does not resolve is gone; the + command is still taken, and ignored, so configurations keep loading */ static int h_dialer(int argc, unsigned char **argv){ - if(conf.demanddialprog) free(conf.demanddialprog); - conf.demanddialprog = strdup((char *)argv[1]); return 0; } diff --git a/src/structures.h b/src/structures.h index 50e580b..57c1352 100644 --- a/src/structures.h +++ b/src/structures.h @@ -882,7 +882,6 @@ struct extparam { struct filter * filters; struct auth *authfuncs; FILE *stdlog; - char* demanddialprog; unsigned char **stringtable; time_t logtime, time; unsigned logdumpsrv, logdumpcli; diff --git a/tests/README.md b/tests/README.md index 03efb58..5ef149b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -154,7 +154,7 @@ takes effect, or that services come back. ### DNS -`fakeresolve` `nscache6` `dialer`. +`fakeresolve` `nscache6`. ### Known limitations, deliberately not asserted