diff options
author | Florian Pritz <bluewind@xinu.at> | 2017-05-12 08:37:15 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-05-12 08:37:15 +0200 |
commit | 3b0ae4f049b7a357f9b2c8ac0c2f9af88155760e (patch) | |
tree | d929d08c214b6505d3e796db0f2f6f9f7e1840cf | |
parent | 599d91629e8d8df8fe63dd81d8a492ab293adac2 (diff) | |
download | pacman-threads.tar.gz pacman-threads.tar.xz |
remove full file loading codethreads
This actually makes everything slower (base base-devel 2sec vs 1.4
normally)
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | lib/libalpm/signing.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index cf93fa2b..b7587d1c 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -543,30 +543,11 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path, memset(&sigdata, 0, sizeof(sigdata)); memset(&filedata, 0, sizeof(filedata)); - char* filecontent; - struct stat statbuf; - - // TODO check return code - stat(path, &statbuf); - - size_t filesize = statbuf.st_size; - - filecontent = malloc(filesize); - if (filecontent == NULL) { - printf("Failed to allocate memory\n"); - goto error; - } - - if (fread(filecontent, filesize, 1, file) != 1) { - // TODO error handling - } - gpg_err = gpgme_new(&ctx); CHECK_ERR(); /* create our necessary data objects to verify the signature */ - //gpg_err = gpgme_data_new_from_stream(&filedata, file); - gpg_err = gpgme_data_new_from_mem(&filedata, filecontent, filesize, 1); + gpg_err = gpgme_data_new_from_stream(&filedata, file); CHECK_ERR(); /* next create data object for the signature */ |