summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-12-01 09:38:33 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-12-01 09:38:33 +0200
commit7fc7ac2161afd379ca8dda58de7eca98299e9ecf (patch)
tree554afd7cba200aac27b3099883bcd15f1b656076
parent89527785bbf5e6410cbb5303238fc4f45c8ab02e (diff)
downloadrpm-7fc7ac2161afd379ca8dda58de7eca98299e9ecf.tar.gz
rpm-7fc7ac2161afd379ca8dda58de7eca98299e9ecf.tar.bz2
rpm-7fc7ac2161afd379ca8dda58de7eca98299e9ecf.zip
Lose url callback mechanism
- not used and cant support it with external helper anyhow
-rw-r--r--rpmio/rpmio.c35
-rw-r--r--rpmio/rpmmessages.h5
2 files changed, 0 insertions, 40 deletions
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index bf6bc8c3c..728d94b7a 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -24,7 +24,6 @@ extern int h_errno;
#include "rpmio/rpmio_internal.h"
#include "rpmio/ugid.h"
-#include <rpmmessages.h>
#include <argv.h>
#include <rpmlog.h>
#include <rpmmacro.h>
@@ -548,32 +547,13 @@ const char * ftpStrerror(int errorNumber)
}
}
-static rpmCallbackFunction urlNotify = NULL;
-
-static void * urlNotifyData = NULL;
-
-static int urlNotifyCount = -1;
-
-void urlSetCallback(rpmCallbackFunction notify, void *notifyData, int notifyCount) {
- urlNotify = notify;
- urlNotifyData = notifyData;
- urlNotifyCount = (notifyCount >= 0) ? notifyCount : 4096;
-}
-
int ufdCopy(FD_t sfd, FD_t tfd)
{
char buf[BUFSIZ];
int itemsRead;
int itemsCopied = 0;
int rc = 0;
- int notifier = -1;
- if (urlNotify) {
- /* FIX: check rc */
- (void)(*urlNotify) (NULL, RPMCALLBACK_INST_OPEN_FILE,
- 0, 0, NULL, urlNotifyData);
- }
-
while (1) {
rc = Fread(buf, sizeof(buf[0]), sizeof(buf), sfd);
if (rc < 0)
@@ -592,26 +572,11 @@ int ufdCopy(FD_t sfd, FD_t tfd)
}
itemsCopied += itemsRead;
- if (urlNotify && urlNotifyCount > 0) {
- int n = itemsCopied/urlNotifyCount;
- if (n != notifier) {
- /* FIX: check rc */
- (void)(*urlNotify) (NULL, RPMCALLBACK_INST_PROGRESS,
- itemsCopied, 0, NULL, urlNotifyData);
- notifier = n;
- }
- }
}
DBGIO(sfd, (stderr, "++ copied %d bytes: %s\n", itemsCopied,
ftpStrerror(rc)));
- if (urlNotify) {
- /* FIX: check rc */
- (void)(*urlNotify) (NULL, RPMCALLBACK_INST_OPEN_FILE,
- itemsCopied, itemsCopied, NULL, urlNotifyData);
- }
-
return rc;
}
diff --git a/rpmio/rpmmessages.h b/rpmio/rpmmessages.h
index 885b801c4..adc5b2892 100644
--- a/rpmio/rpmmessages.h
+++ b/rpmio/rpmmessages.h
@@ -49,11 +49,6 @@ typedef void * (*rpmCallbackFunction)
fnpyKey key,
rpmCallbackData data);
-/**
- */
-void urlSetCallback(rpmCallbackFunction notify, rpmCallbackData notifyData,
- int notifyCount);
-
#ifdef __cplusplus
}
#endif