pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/fetch fetch-1.7:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9b7e0cfb2aa7
branches:  trunk
changeset: 569977:9b7e0cfb2aa7
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Fri Jan 22 13:22:28 2010 +0000

description:
fetch-1.7:
Use connection cache (one per host, up to 16 hosts).
Rename some parameters to avoid shadowing a global variable.

diffstat:

 net/fetch/Makefile      |   5 ++---
 net/fetch/files/fetch.c |  18 ++++++++++--------
 2 files changed, 12 insertions(+), 11 deletions(-)

diffs (83 lines):

diff -r e87387146a17 -r 9b7e0cfb2aa7 net/fetch/Makefile
--- a/net/fetch/Makefile        Fri Jan 22 13:21:09 2010 +0000
+++ b/net/fetch/Makefile        Fri Jan 22 13:22:28 2010 +0000
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.11 2010/01/17 12:02:31 wiz Exp $
+# $NetBSD: Makefile,v 1.12 2010/01/22 13:22:28 joerg Exp $
 #
 
-DISTNAME=      fetch-1.6
-PKGREVISION=   1
+DISTNAME=      fetch-1.7
 CATEGORIES=    net
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r e87387146a17 -r 9b7e0cfb2aa7 net/fetch/files/fetch.c
--- a/net/fetch/files/fetch.c   Fri Jan 22 13:21:09 2010 +0000
+++ b/net/fetch/files/fetch.c   Fri Jan 22 13:22:28 2010 +0000
@@ -304,7 +304,7 @@
 
 #if HAVE_TERMIOS_H && !defined(PREFER_GETPASS)
 static int
-read_password(const char *prompt, char *buf, size_t buf_len)
+read_password(const char *prompt, char *pwbuf, size_t pwbuf_len)
 {
        struct termios tios;
        tcflag_t saved_flags;
@@ -312,13 +312,13 @@
 
        fprintf(stderr, prompt);
        if (tcgetattr(STDIN_FILENO, &tios) != 0)
-               return (fgets(buf, buf_len, stdin) == NULL);
+               return (fgets(pwbuf, pwbuf_len, stdin) == NULL);
 
        saved_flags = tios.c_lflag;
        tios.c_lflag &= ~ECHO;
        tios.c_lflag |= ECHONL|ICANON;
        tcsetattr(STDIN_FILENO, TCSAFLUSH|TCSASOFT, &tios);
-       nopwd = (fgets(buf, buf_len, stdin) == NULL);
+       nopwd = (fgets(pwbuf, pwbuf_len, stdin) == NULL);
        tios.c_lflag = saved_flags;
        tcsetattr(STDIN_FILENO, TCSANOW|TCSASOFT, &tios);
 
@@ -326,7 +326,7 @@
 }
 #elif HAVE_GETPASSPHRASE || HAVE_GETPASS
 static int
-read_password(const char *prompt, char *buf, size_t buf_len)
+read_password(const char *prompt, char *pwbuf, size_t pwbuf_len)
 {
        char *pass;
 
@@ -335,18 +335,18 @@
 #else
        pass = getpass(prompt);
 #endif
-       if (pass == NULL || strlen(pass) >= buf_len)
+       if (pass == NULL || strlen(pass) >= pwbuf_len)
                return 1;
-       strcpy(buf, pass);
+       strcpy(pwbuf, pass);
        return 0;
 }
 #else
 static int
-read_password(const char *prompt, char *buf, size_t buf_len)
+read_password(const char *prompt, char *pwbuf, size_t pwbuf_len)
 {
 
        fprintf(stderr, prompt);
-       return (fgets(buf, buf_len, stdin) == NULL);
+       return (fgets(pwbuf, pwbuf_len, stdin) == NULL);
 }
 #endif
 
@@ -944,6 +944,8 @@
                exit(EX_USAGE);
        }
 
+       fetchConnectionCacheInit(10, 1);
+
        /* allocate buffer */
        if (B_size < MINBUFSIZE)
                B_size = MINBUFSIZE;



Home | Main Index | Thread Index | Old Index