FD_t contentLength field is useless for us too...
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 9 Jun 2008 12:42:24 +0000 (15:42 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 9 Jun 2008 12:42:24 +0000 (15:42 +0300)
rpmio/rpmio.c
rpmio/rpmio_internal.h

index 8e01260..c40484a 100644 (file)
@@ -168,9 +168,7 @@ off_t fdSize(FD_t fd)
 DBGIO(0, (stderr, "==>\tfdSize(%p) rc %ld\n", fd, (long)rc));
 #endif
     FDSANE(fd);
-    if (fd->contentLength >= 0)
-       rc = fd->contentLength;
-    else switch (fd->urlType) {
+    switch (fd->urlType) {
     case URL_IS_PATH:
     case URL_IS_UNKNOWN:
        if (fstat(Fileno(fd), &sb) == 0)
@@ -284,7 +282,7 @@ FD_t fdNew(const char * msg)
     fd->fps[0].fdno = -1;
 
     fd->rd_timeoutsecs = 1;    /* XXX default value used to be -1 */
-    fd->contentLength = fd->bytesRemain = -1;
+    fd->bytesRemain = -1;
     fd->syserrno = 0;
     fd->errcookie = NULL;
     fd->stats = xcalloc(1, sizeof(*fd->stats));
@@ -828,7 +826,7 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o)\n", url, (unsigned)flags, (unsigned)mo
 
     fdSetIo(fd, ufdio);
     fd->rd_timeoutsecs = timeout;
-    fd->contentLength = fd->bytesRemain = -1;
+    fd->bytesRemain = -1;
     fd->urlType = urlType;
 
     if (Fileno(fd) < 0) {
index 524221a..d8b61bd 100644 (file)
@@ -51,7 +51,6 @@ struct _FD_s {
 
     int                rd_timeoutsecs; /* ufdRead: per FD_t timer */
     ssize_t    bytesRemain;    /* ufdio: */
-    ssize_t    contentLength;  /* ufdio: */
 
     int                syserrno;       /* last system errno encountered */
     const void *errcookie;     /* gzdio/bzdio/ufdio: */
@@ -143,15 +142,6 @@ void fdSetFdno(FD_t fd, int fdno)
 /** \ingroup rpmio
  */
 static inline
-void fdSetContentLength(FD_t fd, ssize_t contentLength)
-{
-    FDSANE(fd);
-    fd->contentLength = fd->bytesRemain = contentLength;
-}
-
-/** \ingroup rpmio
- */
-static inline
 void fdPush(FD_t fd, FDIO_t io, void * fp, int fdno)
 {
     FDSANE(fd);