mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-06 22:43:12 +02:00
URL API: add request->connect_timeout & request->transfer_timeout
... in case you want to do fine-tuning. Defaults to DOWNLOAD_CONNECT_TIMEOUT (15 seconds) and DOWNLOAD_TRANSFER_TIMEOUT (20 seconds). For example, the module manager uses a shorter timeout of 7 and 20. (that was already the case, but now it uses the generic api so it needed an option to set it to those values)
This commit is contained in:
+3
-3
@@ -8,7 +8,7 @@
|
||||
#ifndef _WIN32
|
||||
|
||||
#define MODULEMANAGER_CONNECT_TIMEOUT 7
|
||||
#define MODULEMANAGER_READ_TIMEOUT 20
|
||||
#define MODULEMANAGER_TRANSFER_TIMEOUT 20
|
||||
|
||||
typedef struct ManagedModule ManagedModule;
|
||||
|
||||
@@ -618,7 +618,7 @@ int mm_refresh_repository(void)
|
||||
}
|
||||
printf("Checking module repository %s...\n", line);
|
||||
numrepos++;
|
||||
tmpfile = synchronous_http_request(line, 1, MODULEMANAGER_CONNECT_TIMEOUT, MODULEMANAGER_READ_TIMEOUT);
|
||||
tmpfile = synchronous_http_request(line, 1, MODULEMANAGER_CONNECT_TIMEOUT, MODULEMANAGER_TRANSFER_TIMEOUT);
|
||||
if (tmpfile)
|
||||
{
|
||||
if (!mm_parse_repo_db(line, tmpfile))
|
||||
@@ -960,7 +960,7 @@ void mm_install_module(ManagedModule *m)
|
||||
const char *tmpfile;
|
||||
|
||||
printf("Downloading %s from %s...\n", m->name, m->source);
|
||||
tmpfile = synchronous_http_request(m->source, 1, MODULEMANAGER_CONNECT_TIMEOUT, MODULEMANAGER_READ_TIMEOUT);
|
||||
tmpfile = synchronous_http_request(m->source, 1, MODULEMANAGER_CONNECT_TIMEOUT, MODULEMANAGER_TRANSFER_TIMEOUT);
|
||||
if (!tmpfile)
|
||||
{
|
||||
fprintf(stderr, "Repository %s seems to list a module file that cannot be retrieved (%s).\n", m->repo_url, m->source);
|
||||
|
||||
Reference in New Issue
Block a user