summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/handle.h
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-01-15 19:59:45 +0100
committerDave Reisner <d@falconindy.com>2011-03-09 21:22:32 +0100
commit278c84710637a891c3407c3811f61b181359ea75 (patch)
tree9fa1b4d96f7db3e614ebb25ab4780882959f7d37 /lib/libalpm/handle.h
parent75bfe825fc4018173b0d7a3c4029094edb52d93a (diff)
downloadpacman-278c84710637a891c3407c3811f61b181359ea75.tar.gz
pacman-278c84710637a891c3407c3811f61b181359ea75.tar.xz
handle: Add CURL* and CURLcode vars to struct
Adding the CURLcode is necessary in order to return an error string from pm_error. Unlike libfetch, curl returns numerical error numbers and does not maintain a staticly allocated string with the last error generated. Adding the curl object itself to the handle is advantageous (and encouraged by curl_easy_perform(3)) because the handle is reusable for successive operations. This cuts back on overhead when downloading multiple files in a single transaction. Signed-off-by: Dave Reisner <d@falconindy.com>
Diffstat (limited to 'lib/libalpm/handle.h')
-rw-r--r--lib/libalpm/handle.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h
index 2d962fe6..de2dfa1a 100644
--- a/lib/libalpm/handle.h
+++ b/lib/libalpm/handle.h
@@ -29,6 +29,10 @@
#include "alpm.h"
#include "trans.h"
+#ifdef HAVE_LIBCURL
+#include <curl/curl.h>
+#endif
+
typedef struct _pmhandle_t {
/* internal usage */
pmdb_t *db_local; /* local db pointer */
@@ -37,6 +41,12 @@ typedef struct _pmhandle_t {
FILE *lckstream; /* lock file stream pointer if one exists */
pmtrans_t *trans;
+#ifdef HAVE_LIBCURL
+ /* libcurl handle */
+ CURL *curl; /* reusable curl_easy handle */
+ CURLcode curlerr; /* last error produced by curl */
+#endif
+
/* callback functions */
alpm_cb_log logcb; /* Log callback function */
alpm_cb_download dlcb; /* Download callback function */