diff options
-rw-r--r-- | src/core/wee-url.c | 20 | ||||
-rw-r--r-- | src/core/wee-url.h | 2 | ||||
-rw-r--r-- | src/core/weechat.c | 3 |
3 files changed, 25 insertions, 0 deletions
diff --git a/src/core/wee-url.c b/src/core/wee-url.c index 8f77a048d..1eb7d026c 100644 --- a/src/core/wee-url.c +++ b/src/core/wee-url.c @@ -1573,3 +1573,23 @@ weeurl_option_add_to_infolist (struct t_infolist *infolist, return 1; } + +/* + * Initializes URL. + */ + +void +weeurl_init () +{ + curl_global_init (CURL_GLOBAL_ALL); +} + +/* + * Ends URL. + */ + +void +weeurl_end () +{ + curl_global_cleanup (); +} diff --git a/src/core/wee-url.h b/src/core/wee-url.h index cfa8f6f00..934e085d7 100644 --- a/src/core/wee-url.h +++ b/src/core/wee-url.h @@ -62,5 +62,7 @@ extern int weeurl_download (const char *url, struct t_hashtable *options, struct t_hashtable *output); extern int weeurl_option_add_to_infolist (struct t_infolist *infolist, struct t_url_option *option); +extern void weeurl_init (); +extern void weeurl_end (); #endif /* WEECHAT_URL_H */ diff --git a/src/core/weechat.c b/src/core/weechat.c index d91a3300a..9c11dd16b 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -74,6 +74,7 @@ #include "wee-signal.h" #include "wee-string.h" #include "wee-upgrade.h" +#include "wee-url.h" #include "wee-utf8.h" #include "wee-util.h" #include "wee-version.h" @@ -640,6 +641,7 @@ weechat_init (int argc, char *argv[], void (*gui_init_cb)()) * weechat_current_start_timeval.tv_usec) ^ getpid ()); + weeurl_init (); /* initialize URL */ signal_init (); /* initialize signals */ hdata_init (); /* initialize hdata */ hook_init (); /* initialize hooks */ @@ -720,5 +722,6 @@ weechat_end (void (*gui_end_cb)(int clean_exit)) hdata_end (); /* end hdata */ secure_end (); /* end secured data */ string_end (); /* end string */ + weeurl_end (); weechat_shutdown (-1, 0); /* end other things */ } |