Functional http remote globbing through WebDAV.
BUG: Something goofy with Keepalive On still. CVS patchset: 7573 CVS date: 2004/11/11 02:29:51
This commit is contained in:
parent
b1ac9a5146
commit
13b145b6af
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
12
rpmio/tget.c
12
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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue