1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 19:14:46 +02:00

In ConfigItem_include include->url now always exists, and src/url.c is now

always compiled in, both regardless of cURL support or not.
Obviously the cURL functions are not available without cURL and there
are now some #ifdef USE_LIBCURL in url.c

This also fixes the current build to work without cURL
This commit is contained in:
Bram Matthys
2021-08-18 12:23:57 +02:00
parent f85615518e
commit 685e0ee073
8 changed files with 8 additions and 20 deletions
-2
View File
@@ -90,7 +90,6 @@ XCFLAGS=@PTHREAD_CFLAGS@ @PCRE2_CFLAGS@ @ARGON2_CFLAGS@ @CARES_CFLAGS@ @SODIUM_C
IRCDMODE = 711
# Objects that are optional due to optional libraries:
URL=@URL@
GEOIP_CLASSIC_OBJECTS=@GEOIP_CLASSIC_OBJECTS@
GEOIP_CLASSIC_LIBS=@GEOIP_CLASSIC_LIBS@
GEOIP_CLASSIC_CFLAGS=@GEOIP_CLASSIC_CFLAGS@
@@ -120,7 +119,6 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \
'SHELL=${SHELL}' \
'CRYPTOLIB=${CRYPTOLIB}' \
'CRYPTOINCLUDES=${CRYPTOINCLUDES}' \
'URL=${URL}' \
'GEOIP_CLASSIC_OBJECTS=${GEOIP_CLASSIC_OBJECTS}' \
'GEOIP_CLASSIC_LIBS=${GEOIP_CLASSIC_LIBS}' \
'GEOIP_CLASSIC_CFLAGS=${GEOIP_CLASSIC_CFLAGS}'
-3
View File
@@ -129,9 +129,6 @@ AC_DEFUN([CHECK_LIBCURL],
])
LIBS="$LIBS_SAVEDA"
CFLAGS="$CFLAGS_SAVEDA"
URL="url.o"
AC_SUBST(URL)
]) dnl AS_IF(enable_curl)
])
Vendored
-4
View File
@@ -629,7 +629,6 @@ IRCDLIBS
GEOIP_CLASSIC_OBJECTS
GEOIP_CLASSIC_LIBS
GEOIP_CLASSIC_CFLAGS
URL
PTHREAD_CFLAGS
PTHREAD_LIBS
PTHREAD_CC
@@ -8547,9 +8546,6 @@ rm -f core conftest.err conftest.$ac_objext \
LIBS="$LIBS_SAVEDA"
CFLAGS="$CFLAGS_SAVEDA"
URL="url.o"
fi
-2
View File
@@ -1896,10 +1896,8 @@ struct ConfigItem_include {
ConfigItem_include *prev, *next;
ConfigFlag_ban flag;
char *file;
#ifdef USE_LIBCURL
char *url;
char *errorbuf;
#endif
char *included_from;
int included_from_line;
};
+1 -1
View File
@@ -33,7 +33,7 @@ OBJS=dns.o auth.o channel.o crule.o dbuf.o \
api-event.o \
crypt_blowfish.o unrealdb.o updconf.o crashreport.o modulemanager.o \
utf8.o log.o \
openssl_hostname_validation.o $(URL)
openssl_hostname_validation.o url.o
SRC=$(OBJS:%.o=%.c)
+1 -3
View File
@@ -2160,7 +2160,7 @@ int conf_check_complete(void)
{
if (inc->flag.type & INCLUDE_DLQUEUED)
{
config_status("Waiting for %s...", inc->url);
//config_status("Waiting for %s...", inc->url);
return 0;
}
}
@@ -2308,13 +2308,11 @@ int load_conf(char *filename, const char *original_path)
continue;
}
#endif
#ifdef USE_LIBCURL
if (inc->url && !strcmp(original_path, inc->url))
{
counter ++;
continue;
}
#endif
}
if (counter > 1)
{
+2
View File
@@ -1080,8 +1080,10 @@ int InitUnrealIRCd(int argc, char *argv[])
exit(-1);
while (!conf_check_complete())
{
#ifdef USE_LIBCURL
extern EVENT(curl_socket_timeout);
curl_socket_timeout(NULL);
#endif
fd_select(500);
}
if (init_conf(0) < 0)
+4 -5
View File
@@ -22,11 +22,7 @@
extern char *TLSKeyPasswd;
#ifndef _WIN32
extern uid_t irc_uid;
extern gid_t irc_gid;
#endif
#ifdef USE_LIBCURL
CURLM *multihandle;
/* Stores information about the async transfer.
@@ -43,6 +39,7 @@ typedef struct
char errorbuf[CURL_ERROR_SIZE];
time_t cachetime;
} FileHandle;
#endif
/*
* Determines if the given string is a valid URL. Since libcurl
@@ -125,6 +122,7 @@ char *url_getfilename(const char *url)
return raw_strdup("-");
}
#ifdef USE_LIBCURL
/*
* Sets up all of the SSL options necessary to support HTTPS/FTPS
* transfers.
@@ -456,3 +454,4 @@ void download_file_async(const char *url, time_t cachetime, vFP callback, void *
curl_multi_add_handle(multihandle, curl);
}
}
#endif