mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
Enable libfetch connection caching
This will allow downloads to reuse connections if possible, which could make big differences on perceived FTP speed as the connection won't have to be reestablished each time. For the most part, HTTP requests wouldn't be using keep alive anyway so this won't have an effect there. I'm not enthused about having to do this with the library initialization, but there isn't a much better place due to the fact that the loop over databases occurs on the frontend and not the backend. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
8155571183
commit
ce3f4e7800
@ -23,6 +23,11 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
/* connection caching setup */
|
||||||
|
#if defined(INTERNAL_DOWNLOAD)
|
||||||
|
#include <fetch.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* libalpm */
|
/* libalpm */
|
||||||
#include "alpm.h"
|
#include "alpm.h"
|
||||||
#include "alpm_list.h"
|
#include "alpm_list.h"
|
||||||
@ -54,6 +59,10 @@ int SYMEXPORT alpm_initialize(void)
|
|||||||
bindtextdomain("libalpm", LOCALEDIR);
|
bindtextdomain("libalpm", LOCALEDIR);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef INTERNAL_DOWNLOAD
|
||||||
|
fetchConnectionCacheInit(5, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,6 +82,10 @@ int SYMEXPORT alpm_release(void)
|
|||||||
_alpm_handle_free(handle);
|
_alpm_handle_free(handle);
|
||||||
handle = NULL;
|
handle = NULL;
|
||||||
|
|
||||||
|
#ifdef INTERNAL_DOWNLOAD
|
||||||
|
fetchConnectionCacheClose();
|
||||||
|
#endif
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user