diff options
author | jbj <devnull@localhost> | 2004-11-11 02:29:51 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2004-11-11 02:29:51 +0000 |
commit | 13b145b6af842a268d99a6a64fcf4e416ee4e681 (patch) | |
tree | 9d93db5c9414c4453f320437977431ff37a31c6d | |
parent | b1ac9a514607dd0d05fb9ad9a97c2e058e1f9328 (diff) | |
download | librpm-tizen-13b145b6af842a268d99a6a64fcf4e416ee4e681.tar.gz librpm-tizen-13b145b6af842a268d99a6a64fcf4e416ee4e681.tar.bz2 librpm-tizen-13b145b6af842a268d99a6a64fcf4e416ee4e681.zip |
Functional http remote globbing through WebDAV.
BUG: Something goofy with Keepalive On still.
CVS patchset: 7573
CVS date: 2004/11/11 02:29:51
-rw-r--r-- | rpmio/macro.c | 7 | ||||
-rw-r--r-- | rpmio/rpmdav.c | 13 | ||||
-rw-r--r-- | rpmio/tget.c | 12 | ||||
-rw-r--r-- | rpmio/tglob.c | 14 |
4 files changed, 35 insertions, 11 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c index c11bd9398..dba2498fa 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1735,20 +1735,21 @@ fprintf(stderr, "*** rpmGlob argv[%d] \"%s\"\n", argc, argv[argc]); maxb = nb; } - nb = ((ut > URL_IS_DASH && ut != URL_IS_FTP) ? (path - av[j]) : 0); + nb = ((ut == URL_IS_PATH) ? (path - av[j]) : 0); maxb += nb; maxb += 1; globURL = globRoot = xmalloc(maxb); switch (ut) { - case URL_IS_HTTPS: - case URL_IS_HTTP: case URL_IS_PATH: case URL_IS_DASH: strncpy(globRoot, av[j], nb); /*@switchbreak@*/ break; + case URL_IS_HTTPS: + case URL_IS_HTTP: case URL_IS_FTP: case URL_IS_UNKNOWN: + default: /*@switchbreak@*/ break; } globRoot += nb; diff --git a/rpmio/rpmdav.c b/rpmio/rpmdav.c index f53229b2c..4f4cb79ec 100644 --- a/rpmio/rpmdav.c +++ b/rpmio/rpmdav.c @@ -829,7 +829,7 @@ static int my_result(const char * msg, int ret, /*@null@*/ FILE * fp) return ret; } -#ifndef DYING +#ifdef DYING static void hexdump(const unsigned char * buf, ssize_t len) /*@*/ { @@ -1088,8 +1088,10 @@ assert(fd->req != NULL); if (_dav_debug < 0) fprintf(stderr, "*** davWrite(%p,%p,0x%x) rc 0x%x\n", cookie, buf, count, rc); +#ifdef DYING if (count > 0) hexdump(buf, count); +#endif return rc; } @@ -1559,6 +1561,15 @@ DIR * davOpendir(const char * path) int ac, nac; int rc; + /* HACK: glob does not pass dirs with trailing '/' */ + nb = strlen(path)+1; + if (path[nb-1] != '/') { + char * t = alloca(nb+1); + *t = '\0'; + (void) stpcpy( stpcpy(t, path), "/"); + path = t; + } + if (_dav_debug < 0) fprintf(stderr, "*** davOpendir(%s)\n", path); diff --git a/rpmio/tget.c b/rpmio/tget.c index fdea5e4cb..0faf52bc8 100644 --- a/rpmio/tget.c +++ b/rpmio/tget.c @@ -11,9 +11,9 @@ static int _debug = 0; extern int noNeon; -#define HTTPSPATH "https://wellfleet.jbj.org/test.txt" -#define HTTPPATH "http://wellfleet.jbj.org/test.txt" -#define FTPPATH "ftp://wellfleet.jbj.org/test.txt" +#define HTTPSPATH "https://localhost/test.txt" +#define HTTPPATH "http://localhost/test.txt" +#define FTPPATH "ftp://localhost/test.txt" #define DIRPATH "/var/ftp/test.txt" static char * httpspath = HTTPSPATH; static char * httppath = HTTPPATH; @@ -75,10 +75,10 @@ main(int argc, const char *argv[]) _av_debug = -1; _ftp_debug = -1; _dav_debug = 1; -#if 0 +#if 1 readFile(dirpath); #endif -#if 0 +#if 1 readFile(ftppath); readFile(ftppath); readFile(ftppath); @@ -88,7 +88,7 @@ _dav_debug = 1; readFile(httppath); readFile(httppath); #endif -#if 0 +#if 1 readFile(httpspath); readFile(httpspath); readFile(httpspath); diff --git a/rpmio/tglob.c b/rpmio/tglob.c index 003f24085..29f85af52 100644 --- a/rpmio/tglob.c +++ b/rpmio/tglob.c @@ -9,10 +9,16 @@ static int _debug = 0; +extern int noNeon; + #define HTTPSPATH "https://localhost/rawhide/test/*.rpm" +#if 0 #define HTTPPATH "http://localhost/rawhide/test/*.rpm" +#else +#define HTTPPATH "http://localhost/rawhide/*.rpm" +#endif #define FTPPATH "ftp://localhost/pub/rawhide/packages/test/*.rpm" -#define DIRPATH "/var/ftp/pub/rawhide/packages/test" +#define DIRPATH "/var/ftp/pub/rawhide/packages/test/*.rpm" static char * dirpath = DIRPATH; static char * ftppath = FTPPATH; static char * httppath = HTTPPATH; @@ -46,6 +52,8 @@ static struct poptOption optionsTable[] = { { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL }, { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1, N_("debug protocol data stream"), NULL}, + { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1, + N_("disable use of libneon for HTTP"), NULL}, { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1, N_("debug rpmio I/O"), NULL}, { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1, @@ -79,10 +87,14 @@ main(int argc, const char *argv[]) _av_debug = -1; _ftp_debug = -1; _dav_debug = -1; +#if 0 printGlob(dirpath); printGlob(ftppath); +#endif printGlob(httppath); +#if 0 printGlob(httpspath); +#endif return 0; } |