mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
help: the features of the build listed, and the tests skip what they need
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Has been cancelled
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Has been cancelled
3proxy --help (and the usage message of a bad invocation) now lists what the build was made with: TLS and its backend, RADIUS, PCRE, IPv6, UNIX sockets, the built-in HTTP server, transparency, ODBC and the optional proxy services. The test runner reads the list before the first case and the cases state the features they need with t.skip_unless(), so a build without a feature skips its cases instead of failing them; a binary too old to report anything skips the cases with needs and runs the rest.
This commit is contained in:
1 parent
83045b0443
commit
235f899668
37 files changed
+212
-15
No files matched your search
+22
-12
@@ -293,6 +293,21 @@ void cyclestep(void){
|
||||
#define RETURN(x) {res = x; goto CLEARRETURN;}
|
||||
|
||||
|
||||
static void printusage(struct extparam *cconf, int argc, char * argv[]){
|
||||
|
||||
fprintf(stderr, "Usage: %s [conffile]\n", argv[0]);
|
||||
#ifdef _WIN32
|
||||
fprintf(stderr, "\n\t%s --install [conffile]\n\tto install as service\n"
|
||||
"\n\t%s --remove\n\tto remove service\n", argv[0], argv[0]);
|
||||
#else
|
||||
fprintf(stderr, "\n if conffile is missing, configuration is expected from stdin\n");
|
||||
#endif
|
||||
fprintf(stderr, "\n\t%s --help\n\tthis message\n", argv[0]);
|
||||
fprintf(stderr, "available socket options:\n\t%s\n", printopts("\n\t"));
|
||||
fprintf(stderr, "built with:\n\t%s\n", printfeatures("\n\t"));
|
||||
fprintf(stderr, "\n%s %s\n%s\n", cconf->stringtable[2], cconf->stringtable[3], copyright);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
|
||||
@@ -310,6 +325,10 @@ int main(int argc, char * argv[]) {
|
||||
|
||||
|
||||
conf->stringtable = strings;
|
||||
if(argc == 2 && (!strcmp((char *)argv[1], "--help") || !strcmp((char *)argv[1], "-h"))) {
|
||||
printusage(conf, argc, argv);
|
||||
return 0;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
if((argc == 2 || argc == 3)&& !strcmp((char *)argv[1], "--install")) {
|
||||
|
||||
@@ -381,20 +400,11 @@ int main(int argc, char * argv[]) {
|
||||
if(!fp) fp = stdin;
|
||||
#endif
|
||||
}
|
||||
if(argc > 2 || !(fp)) {
|
||||
|
||||
fprintf(stderr, "Usage: %s [conffile]\n", argv[0]);
|
||||
#ifdef _WIN32
|
||||
fprintf(stderr, "\n\t%s --install [conffile]\n\tto install as service\n"
|
||||
"\n\t%s --remove\n\tto remove service\n", argv[0], argv[0]);
|
||||
#else
|
||||
fprintf(stderr, "\n if conffile is missing, configuration is expected from stdin\n");
|
||||
#endif
|
||||
fprintf(stderr, "available socket options:\n\t%s\n", printopts("\n\t"));
|
||||
fprintf(stderr, "\n%s %s\n%s\n", conf->stringtable[2], conf->stringtable[3], copyright);
|
||||
if(argc > 2 || !(fp)) {
|
||||
|
||||
printusage(conf, argc, argv);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
nsopen(); /* before a chroot in the configuration takes /proc away */
|
||||
|
||||
@@ -86,6 +86,69 @@ char * printopts(char *sep){
|
||||
}
|
||||
|
||||
|
||||
char featsbuf[1024];
|
||||
|
||||
/* The features of this build, by the names the manual and the test suite
|
||||
know them, so a user can see what a binary was made with. */
|
||||
char * printfeatures(char *sep){
|
||||
int pos=0;
|
||||
|
||||
#define ADDFEATURE(x) pos += sprintf(featsbuf+pos,"%s%s",pos?sep:"",x)
|
||||
#ifdef WITH_SSL
|
||||
ADDFEATURE("ssl");
|
||||
#ifdef WITH_WOLFSSL
|
||||
ADDFEATURE("wolfssl");
|
||||
#else
|
||||
ADDFEATURE("openssl");
|
||||
#endif
|
||||
#endif
|
||||
#ifndef NORADIUS
|
||||
ADDFEATURE("radius");
|
||||
#endif
|
||||
#ifdef WITH_PCRE
|
||||
ADDFEATURE("pcre");
|
||||
#endif
|
||||
#ifndef NOIPV6
|
||||
ADDFEATURE("ipv6");
|
||||
#endif
|
||||
#ifdef WITH_UN
|
||||
ADDFEATURE("unix");
|
||||
#endif
|
||||
#ifdef WITH_HTTPSRV
|
||||
ADDFEATURE("httpsrv");
|
||||
#endif
|
||||
#ifdef WITH_TRANSPARENT
|
||||
ADDFEATURE("transparent");
|
||||
#endif
|
||||
#ifdef WITH_NETFILTER
|
||||
ADDFEATURE("netfilter");
|
||||
#endif
|
||||
#ifdef WITH_PF
|
||||
ADDFEATURE("pf");
|
||||
#endif
|
||||
#ifdef WITH_ODBC
|
||||
ADDFEATURE("odbc");
|
||||
#endif
|
||||
#ifdef WITH_FTP
|
||||
ADDFEATURE("ftppr");
|
||||
#endif
|
||||
#ifdef WITH_POP3P
|
||||
ADDFEATURE("pop3p");
|
||||
#endif
|
||||
#ifdef WITH_SMTPP
|
||||
ADDFEATURE("smtpp");
|
||||
#endif
|
||||
#ifdef WITH_IMAPP
|
||||
ADDFEATURE("imapp");
|
||||
#endif
|
||||
#ifndef NOPLUGINS
|
||||
ADDFEATURE("plugins");
|
||||
#endif
|
||||
#undef ADDFEATURE
|
||||
return featsbuf;
|
||||
}
|
||||
|
||||
|
||||
/* A comma separated list of options, each NAME or NAME=VALUE; a name alone
|
||||
stands for 1, or for TCP_MAXSEG for the value of maxseg. Options are added
|
||||
to what is already set, so a default is changed only by naming it, and
|
||||
|
||||
@@ -640,6 +640,7 @@ extern struct socketoptions {
|
||||
int getopts(const char *s, struct sockoptset *opts);
|
||||
void setopts(SOCKET s, const struct sockoptset *opts, int maxseg);
|
||||
char * printopts(char *sep);
|
||||
char * printfeatures(char *sep);
|
||||
|
||||
|
||||
#define WEBBANNERS 35
|
||||
|
||||
Reference in new issue
Block a user