1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

[config] curl's ftp related code requires libevent. Refs #240

It does not compile with libev.
This commit is contained in:
Witold Filipczyk 2023-06-22 20:07:08 +02:00
parent e69168c58a
commit 651e4e72e8
5 changed files with 10 additions and 7 deletions

View File

@ -77,7 +77,7 @@ do { \
#define FD_SETSIZE 1024
#endif
#ifdef USE_LIBEVENT
#ifdef CONFIG_LIBEVENT
/* Information associated with a specific easy handle */
typedef struct _ConnInfo
@ -777,6 +777,7 @@ select_loop(void (*init)(void))
periodic_redraw_all_terminals(NULL);
#ifdef USE_LIBEVENT
if (event_enabled) {
#if defined(CONFIG_LIBCURL) && defined(CONFIG_LIBEVENT)
memset(&g, 0, sizeof(GlobalInfo));
g.evbase = event_base;
curl_global_init(CURL_GLOBAL_DEFAULT);
@ -793,6 +794,7 @@ select_loop(void (*init)(void))
curl_multi_setopt(g.multi, CURLMOPT_TIMERDATA, &g);
/* we do not call any curl_multi_socket*() function yet as we have no handles added! */
#endif
while (!program.terminate) {
check_signals();
@ -805,11 +807,12 @@ select_loop(void (*init)(void))
}
kill_timer(&periodic_redraw_timer);
#if defined(CONFIG_LIBCURL) && defined(CONFIG_LIBEVENT)
event_del(&g.timer_event);
//event_base_free(g.evbase);
curl_multi_cleanup(g.multi);
curl_global_cleanup();
#endif
return;
} else
#endif

View File

@ -10,7 +10,7 @@ extern "C" {
extern struct module ftpes_protocol_module;
#if defined(CONFIG_FTP) && defined(CONFIG_LIBCURL)
#if defined(CONFIG_FTP) && defined(CONFIG_LIBCURL) && defined(CONFIG_LIBEVENT)
extern protocol_handler_T ftpes_protocol_handler;
#else
#define ftpes_protocol_handler NULL

View File

@ -10,7 +10,7 @@ extern "C" {
extern struct module sftp_protocol_module;
#ifdef CONFIG_LIBCURL
#if defined(CONFIG_LIBCURL) && defined(CONFIG_LIBEVENT)
extern protocol_handler_T sftp_protocol_handler;
#else
#define sftp_protocol_handler NULL

View File

@ -1,7 +1,7 @@
if conf_data.get('CONFIG_BITTORRENT')
subdir('bittorrent')
endif
if conf_data.get('CONFIG_LIBCURL')
if conf_data.get('CONFIG_LIBCURL') and conf_data.get('CONFIG_LIBEVENT')
subdir('curl')
endif
if conf_data.get('CONFIG_FINGER')

View File

@ -317,7 +317,7 @@ static struct module *protocol_submodules[] = {
#endif
#ifdef CONFIG_FTP
&ftp_protocol_module,
#ifdef CONFIG_LIBCURL
#if defined(CONFIG_LIBCURL) && defined(CONFIG_LIBEVENT)
&ftpes_protocol_module,
#endif
#endif
@ -331,7 +331,7 @@ static struct module *protocol_submodules[] = {
#ifdef CONFIG_NNTP
&nntp_protocol_module,
#endif
#ifdef CONFIG_LIBCURL
#if defined(CONFIG_LIBCURL) && defined(CONFIG_LIBEVENT)
&sftp_protocol_module,
#endif
#ifdef CONFIG_SMB