summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/dload.h
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-11 18:50:15 +0200
committerDave Reisner <dreisner@archlinux.org>2011-07-06 04:58:27 +0200
commit6c9b82e72ac067207b1d66a3112485ad8d690f32 (patch)
tree0b40281e325ac9d4dc749566192df6349667bb67 /lib/libalpm/dload.h
parent44889da5b704483b7ee013ec828ff64b64980de8 (diff)
downloadpacman-6c9b82e72ac067207b1d66a3112485ad8d690f32.tar.gz
pacman-6c9b82e72ac067207b1d66a3112485ad8d690f32.tar.xz
dload: handle irregular URLs
URLs might end with a slash and follow redirects, or could be a generated by a script such as /getpkg.php?id=12345. In both cases, we may have a better filename that we can write to, taken from either content-disposition header, or the effective URL. Specific to the first case, we write to a temporary file of the format 'alpmtmp.XXXXXX', where XXXXXX is randomized by mkstemp(3). Since this is a randomly generated file, we cannot support resuming and the file is unlinked in the event of an interrupt. We also run into the possibility of changing out the filename from under alpm on a -U operation, so callers of _alpm_download can optionally pass a pointer to a *char to be filled in by curl_download_internal with the actual filename we wrote to. Any sync operation will pass a NULL pointer here, as we rely on specific names for packages from a mirror. Fixes FS#22645. Signed-off-by: Dave Reisner <d@falconindy.com>
Diffstat (limited to 'lib/libalpm/dload.h')
-rw-r--r--lib/libalpm/dload.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libalpm/dload.h b/lib/libalpm/dload.h
index 0cdd9001..351b2b30 100644
--- a/lib/libalpm/dload.h
+++ b/lib/libalpm/dload.h
@@ -29,11 +29,12 @@
struct fileinfo {
alpm_handle_t *handle;
const char *filename;
+ char *cd_filename;
double initial_size;
};
int _alpm_download(alpm_handle_t *handle, const char *url, const char *localpath,
- int force, int allow_resume, int errors_ok);
+ char **final_file, int force, int allow_resume, int errors_ok);
#endif /* _ALPM_DLOAD_H */