1 --- rpm-4.4.8/rpmio/rpmdav.c.orig 2007-02-20 00:51:07.000000000 +0100
2 +++ rpm-4.4.8/rpmio/rpmdav.c 2007-04-08 20:07:07.814412143 +0200
10 -#include "ne_dates.h"
11 -#include "ne_locks.h"
13 -#define NEONBLOWSCHUNKS
14 -#ifndef NEONBLOWSCHUNKS
15 -/* HACK: include ne_private.h to access sess->socket for now. */
16 -#include "../neon/src/ne_private.h"
19 -#include "ne_props.h"
20 -#include "ne_request.h"
21 -#include "ne_socket.h"
22 -#include "ne_string.h"
23 -#include "ne_utils.h"
25 -/* XXX API changes for neon-0.26.0 */
26 -#if !defined(NE_FREE)
27 -#define ne_set_persist(_sess, _flag)
28 -#define ne_propfind_set_private(_pfh, _create_item, NULL) \
29 - ne_propfind_set_private(_pfh, _create_item, NULL, NULL)
32 #include <rpmio_internal.h>
34 #define _RPMDAV_INTERNAL
38 /* =============================================================== */
39 -int davFree(urlinfo u)
40 - /*@globals internalState @*/
41 - /*@modifies u, internalState @*/
44 - if (u->sess != NULL) {
45 - ne_session_destroy(u->sess);
48 - switch (u->urltype) {
50 - /*@notreached@*/ break;
54 - u->capabilities = _free(u->capabilities);
55 - if (u->lockstore != NULL)
56 - ne_lockstore_destroy(u->lockstore);
57 - u->lockstore = NULL;
65 -static void davProgress(void * userdata, off_t current, off_t total)
68 - urlinfo u = userdata;
73 -assert(sess != NULL);
74 -assert(u == ne_get_session_private(sess, "urlinfo"));
76 - u->current = current;
80 -fprintf(stderr, "*** davProgress(%p,0x%x:0x%x) sess %p u %p\n", userdata, (unsigned int)current, (unsigned int)total, sess, u);
83 -static void davNotify(void * userdata,
84 - ne_conn_status connstatus, const char * info)
87 - urlinfo u = userdata;
90 - static const char * connstates[] = {
100 -assert(sess != NULL);
101 -assert(u == ne_get_session_private(sess, "urlinfo"));
105 - ne_conn_namelookup, /* lookup up hostname (info = hostname) */
106 - ne_conn_connecting, /* connecting to host (info = hostname) */
107 - ne_conn_connected, /* connected to host (info = hostname) */
108 - ne_conn_secure /* connection now secure (info = crypto level) */
112 - u->connstatus = connstatus;
116 -fprintf(stderr, "*** davNotify(%p,%d,%p) sess %p u %p %s\n", userdata, connstatus, info, sess, u, connstates[ (connstatus < 4 ? connstatus : 4)]);
121 -static void davCreateRequest(ne_request * req, void * userdata,
122 - const char * method, const char * uri)
125 - urlinfo u = userdata;
127 - void * private = NULL;
128 - const char * id = "urlinfo";
131 -assert(u->sess != NULL);
132 -assert(req != NULL);
133 - sess = ne_get_session(req);
134 -assert(sess == u->sess);
135 -assert(u == ne_get_session_private(sess, "urlinfo"));
137 -assert(sess != NULL);
138 - private = ne_get_session_private(sess, id);
139 -assert(u == private);
142 -fprintf(stderr, "*** davCreateRequest(%p,%p,%s,%s) %s:%p\n", req, userdata, method, uri, id, private);
145 -static void davPreSend(ne_request * req, void * userdata, ne_buffer * buf)
147 - urlinfo u = userdata;
149 - const char * id = "fd";
153 -assert(u->sess != NULL);
154 -assert(req != NULL);
155 - sess = ne_get_session(req);
156 -assert(sess == u->sess);
157 -assert(u == ne_get_session_private(sess, "urlinfo"));
159 - fd = ne_get_request_private(req, id);
162 -fprintf(stderr, "*** davPreSend(%p,%p,%p) sess %p %s %p\n", req, userdata, buf, sess, id, fd);
164 -fprintf(stderr, "-> %s\n", buf->data);
168 -static int davPostSend(ne_request * req, void * userdata, const ne_status * status)
171 - urlinfo u = userdata;
173 - const char * id = "fd";
177 -assert(u->sess != NULL);
178 -assert(req != NULL);
179 - sess = ne_get_session(req);
180 -assert(sess == u->sess);
181 -assert(u == ne_get_session_private(sess, "urlinfo"));
183 - fd = ne_get_request_private(req, id);
187 -fprintf(stderr, "*** davPostSend(%p,%p,%p) sess %p %s %p %s\n", req, userdata, status, sess, id, fd, ne_get_error(sess));
192 -static void davDestroyRequest(ne_request * req, void * userdata)
195 - urlinfo u = userdata;
197 - const char * id = "fd";
201 -assert(u->sess != NULL);
202 -assert(req != NULL);
203 - sess = ne_get_session(req);
204 -assert(sess == u->sess);
205 -assert(u == ne_get_session_private(sess, "urlinfo"));
207 - fd = ne_get_request_private(req, id);
210 -fprintf(stderr, "*** davDestroyRequest(%p,%p) sess %p %s %p\n", req, userdata, sess, id, fd);
213 -static void davDestroySession(void * userdata)
216 - urlinfo u = userdata;
218 - void * private = NULL;
219 - const char * id = "urlinfo";
222 -assert(u->sess != NULL);
224 -assert(u == ne_get_session_private(sess, "urlinfo"));
226 -assert(sess != NULL);
227 - private = ne_get_session_private(sess, id);
228 -assert(u == private);
231 -fprintf(stderr, "*** davDestroySession(%p) sess %p %s %p\n", userdata, sess, id, private);
235 -davVerifyCert(void *userdata, int failures, const ne_ssl_certificate *cert)
238 - const char *hostname = userdata;
241 -fprintf(stderr, "*** davVerifyCert(%p,%d,%p) %s\n", userdata, failures, cert, hostname);
243 - return 0; /* HACK: trust all server certificates. */
246 -static int davConnect(urlinfo u)
247 - /*@globals internalState @*/
248 - /*@modifies u, internalState @*/
250 - const char * path = NULL;
253 - /* HACK: hkp:// has no steenkin' options */
254 - if (!(u->urltype == URL_IS_HTTP || u->urltype == URL_IS_HTTPS))
257 - /* HACK: where should server capabilities be read? */
258 - (void) urlPath(u->url, &path);
259 - /* HACK: perhaps capture Allow: tag, look for PUT permitted. */
260 - /* XXX [hdr] Allow: GET,HEAD,POST,OPTIONS,TRACE */
261 - rc = ne_options(u->sess, path, u->capabilities);
264 - { ne_server_capabilities *cap = u->capabilities;
265 - if (cap->dav_class1)
266 - u->allow |= RPMURL_SERVER_HASDAVCLASS1;
268 - u->allow &= ~RPMURL_SERVER_HASDAVCLASS1;
269 - if (cap->dav_class2)
270 - u->allow |= RPMURL_SERVER_HASDAVCLASS2;
272 - u->allow &= ~RPMURL_SERVER_HASDAVCLASS2;
273 - if (cap->dav_executable)
274 - u->allow |= RPMURL_SERVER_HASDAVEXEC;
276 - u->allow &= ~RPMURL_SERVER_HASDAVEXEC;
279 - /* HACK: "301 Moved Permanently" on empty subdir. */
280 - if (!strncmp("301 ", ne_get_error(u->sess), sizeof("301 ")-1))
282 - errno = EIO; /* HACK: more precise errno. */
285 - errno = ENOENT; /* HACK: errno same as non-existent path. */
287 - case NE_CONNECT: /* HACK: errno set already? */
291 -fprintf(stderr, "*** Connect to %s:%d failed(%d):\n\t%s\n",
292 - u->host, u->port, rc, ne_get_error(u->sess));
296 - /* HACK: sensitive to error returns? */
297 - u->httpVersion = (ne_version_pre_http11(u->sess) ? 0 : 1);
302 -static int davInit(const char * url, urlinfo * uret)
303 - /*@globals internalState @*/
304 - /*@modifies *uret, internalState @*/
309 -/*@-globs@*/ /* FIX: h_errno annoyance. */
310 - if (urlSplit(url, &u))
311 - return -1; /* XXX error returns needed. */
314 - if (u->url != NULL && u->sess == NULL)
315 - switch (u->urltype) {
317 - assert(u->urltype != u->urltype);
318 - /*@notreached@*/ break;
322 - { ne_server_capabilities * capabilities;
324 - /* HACK: oneshots should be done Somewhere Else Instead. */
326 - rc = ((_dav_debug < 0) ? NE_DBG_HTTP : 0);
327 - ne_debug_init(stderr, rc); /* XXX oneshot? */
329 - rc = ne_sock_init(); /* XXX oneshot? */
331 - u->lockstore = ne_lockstore_create(); /* XXX oneshot? */
333 - u->capabilities = capabilities = xcalloc(1, sizeof(*capabilities));
334 - u->sess = ne_session_create(u->scheme, u->host, u->port);
336 - ne_lockstore_register(u->lockstore, u->sess);
338 - if (u->proxyh != NULL)
339 - ne_session_proxy(u->sess, u->proxyh, u->proxyp);
342 - { const ne_inet_addr ** addrs;
344 - ne_set_addrlist(u->sess, addrs, n);
348 - ne_set_progress(u->sess, davProgress, u);
349 - ne_set_status(u->sess, davNotify, u);
351 - ne_set_persist(u->sess, 1);
352 - ne_set_read_timeout(u->sess, httpTimeoutSecs);
353 - ne_set_useragent(u->sess, PACKAGE "/" PACKAGE_VERSION);
355 - /* XXX check that neon is ssl enabled. */
356 - if (!strcasecmp(u->scheme, "https"))
357 - ne_ssl_set_verify(u->sess, davVerifyCert, (char *)u->host);
359 - ne_set_session_private(u->sess, "urlinfo", u);
361 - ne_hook_destroy_session(u->sess, davDestroySession, u);
363 - ne_hook_create_request(u->sess, davCreateRequest, u);
364 - ne_hook_pre_send(u->sess, davPreSend, u);
365 - ne_hook_post_send(u->sess, davPostSend, u);
366 - ne_hook_destroy_request(u->sess, davDestroyRequest, u);
368 - /* HACK: where should server capabilities be read? */
369 - rc = davConnect(u);
378 - *uret = urlLink(u, __FUNCTION__);
380 - u = urlFree(u, "urlSplit (davInit)");
385 -/* =============================================================== */
386 -enum fetch_rtype_e {
393 -struct fetch_resource_s {
395 - struct fetch_resource_s *next;
399 - enum fetch_rtype_e type;
403 - int is_vcr; /* Is version resource. 0: no vcr, 1 checkin 2 checkout */
404 - char *error_reason; /* error string returned for this resource */
405 - int error_status; /* error status returned for this resource */
409 -static void *fetch_destroy_item(/*@only@*/ struct fetch_resource_s *res)
410 - /*@modifies res @*/
413 - ne_free(res->error_reason);
420 -static void *fetch_destroy_list(/*@only@*/ struct fetch_resource_s *res)
421 - /*@modifies res @*/
423 - struct fetch_resource_s *next;
425 - for (; res != NULL; res = next) {
427 - res = fetch_destroy_item(res);
434 -static void *fetch_create_item(/*@unused@*/ void *userdata, /*@unused@*/ const char *uri)
437 - struct fetch_resource_s * res = ne_calloc(sizeof(*res));
441 -/* =============================================================== */
442 -struct fetch_context_s {
443 -/*@relnull@*/ /*@dependent@*/
444 - struct fetch_resource_s **resrock;
446 - unsigned int include_target; /* Include resource at href */
452 -/*@null@*/ /*@shared@*/
460 -static void *fetch_destroy_context(/*@only@*/ /*@null@*/ struct fetch_context_s *ctx)
461 - /*@globals internalState @*/
462 - /*@modifies ctx, internalState @*/
466 - if (ctx->av != NULL)
467 - ctx->av = argvFree(ctx->av);
468 - ctx->modes = _free(ctx->modes);
469 - ctx->sizes = _free(ctx->sizes);
470 - ctx->mtimes = _free(ctx->mtimes);
471 - ctx->u = urlFree(ctx->u, __FUNCTION__);
472 - ctx->uri = _free(ctx->uri);
474 - memset(ctx, 0, sizeof(*ctx));
481 -static void *fetch_create_context(const char *uri, /*@null@*/ struct stat *st)
482 - /*@globals internalState @*/
483 - /*@modifies internalState @*/
485 - struct fetch_context_s * ctx;
488 -/*@-globs@*/ /* FIX: h_errno annoyance. */
489 - if (urlSplit(uri, &u))
493 - ctx = ne_calloc(sizeof(*ctx));
494 - ctx->uri = xstrdup(uri);
495 - ctx->u = urlLink(u, __FUNCTION__);
496 - if ((ctx->st = st) != NULL)
497 - memset(ctx->st, 0, sizeof(*ctx->st));
501 -/*@unchecked@*/ /*@observer@*/
502 -static const ne_propname fetch_props[] = {
503 - { "DAV:", "getcontentlength" },
504 - { "DAV:", "getlastmodified" },
505 - { "http://apache.org/dav/props/", "executable" },
506 - { "DAV:", "resourcetype" },
507 - { "DAV:", "checked-in" },
508 - { "DAV:", "checked-out" },
512 -#define ELM_resourcetype (NE_PROPS_STATE_TOP + 1)
513 -#define ELM_collection (NE_PROPS_STATE_TOP + 2)
515 -/*@unchecked@*/ /*@observer@*/
516 -static const struct ne_xml_idmap fetch_idmap[] = {
517 - { "DAV:", "resourcetype", ELM_resourcetype },
518 - { "DAV:", "collection", ELM_collection }
521 -static int fetch_startelm(void *userdata, int parent,
522 - const char *nspace, const char *name,
523 - /*@unused@*/ const char **atts)
526 - ne_propfind_handler *pfh = userdata;
527 - struct fetch_resource_s *r = ne_propfind_current_private(pfh);
528 - int state = ne_xml_mapid(fetch_idmap, NE_XML_MAPLEN(fetch_idmap),
532 - !((parent == NE_207_STATE_PROP && state == ELM_resourcetype) ||
533 - (parent == ELM_resourcetype && state == ELM_collection)))
534 - return NE_XML_DECLINE;
536 - if (state == ELM_collection) {
537 - r->type = resr_collection;
543 -static int fetch_compare(const struct fetch_resource_s *r1,
544 - const struct fetch_resource_s *r2)
547 - /* Sort errors first, then collections, then alphabetically */
548 - if (r1->type == resr_error) {
550 - } else if (r2->type == resr_error) {
552 - } else if (r1->type == resr_collection) {
553 - if (r2->type != resr_collection) {
556 - return strcmp(r1->uri, r2->uri);
559 - if (r2->type != resr_collection) {
560 - return strcmp(r1->uri, r2->uri);
567 -static void fetch_results(void *userdata, void *uarg,
568 - const ne_prop_result_set *set)
571 - struct fetch_context_s *ctx = userdata;
572 - struct fetch_resource_s *current, *previous, *newres;
573 - const char *clength, *modtime, *isexec;
574 - const char *checkin, *checkout;
575 - const ne_status *status = NULL;
576 - const char * path = NULL;
578 -#if !defined(NE_FREE)
579 - const ne_uri * uri = uarg;
580 - (void) urlPath(uri->path, &path);
582 - const char * uri = uarg;
583 - (void) urlPath(uri, &path);
588 - newres = ne_propset_private(set);
591 -fprintf(stderr, "==> %s in uri %s\n", path, ctx->uri);
593 - if (ne_path_compare(ctx->uri, path) == 0 && !ctx->include_target) {
594 - /* This is the target URI */
596 -fprintf(stderr, "==> %s skipping target resource.\n", path);
597 - /* Free the private structure. */
598 -/*@-dependenttrans -exposetrans@*/
600 -/*@=dependenttrans =exposetrans@*/
604 - newres->uri = ne_strdup(path);
607 - clength = ne_propset_value(set, &fetch_props[0]);
608 - modtime = ne_propset_value(set, &fetch_props[1]);
609 - isexec = ne_propset_value(set, &fetch_props[2]);
610 - checkin = ne_propset_value(set, &fetch_props[4]);
611 - checkout = ne_propset_value(set, &fetch_props[5]);
615 - if (clength == NULL)
616 - status = ne_propset_status(set, &fetch_props[0]);
617 - if (modtime == NULL)
618 - status = ne_propset_status(set, &fetch_props[1]);
621 - if (newres->type == resr_normal && status != NULL) {
622 - /* It's an error! */
623 - newres->error_status = status->code;
625 - /* Special hack for Apache 1.3/mod_dav */
626 - if (strcmp(status->reason_phrase, "status text goes here") == 0) {
628 - if (status->code == 401) {
629 - desc = _("Authorization Required");
630 - } else if (status->klass == 3) {
631 - desc = _("Redirect");
632 - } else if (status->klass == 5) {
633 - desc = _("Server Error");
635 - desc = _("Unknown Error");
637 - newres->error_reason = ne_strdup(desc);
639 - newres->error_reason = ne_strdup(status->reason_phrase);
641 - newres->type = resr_error;
644 - if (isexec && strcasecmp(isexec, "T") == 0) {
645 - newres->is_executable = 1;
647 - newres->is_executable = 0;
651 - newres->modtime = ne_httpdate_parse(modtime);
654 - newres->size = atoi(clength);
658 - newres->is_vcr = 1;
659 - } else if (checkout) {
660 - newres->is_vcr = 2;
662 - newres->is_vcr = 0;
665 - for (current = *ctx->resrock, previous = NULL; current != NULL;
666 - previous = current, current = current->next)
668 - if (fetch_compare(current, newres) >= 0) {
673 - previous->next = newres;
675 -/*@-boundswrite -dependenttrans @*/
676 - *ctx->resrock = newres;
677 -/*@=boundswrite =dependenttrans @*/
679 - newres->next = current;
682 -static int davFetch(const urlinfo u, struct fetch_context_s * ctx)
683 - /*@globals internalState @*/
684 - /*@modifies ctx, internalState @*/
686 - const char * path = NULL;
687 - int depth = 1; /* XXX passed arg? */
688 - unsigned int include_target = 0; /* XXX passed arg? */
689 - struct fetch_resource_s * resitem = NULL;
690 - struct fetch_resource_s ** resrock = &resitem; /* XXX passed arg? */
691 - ne_propfind_handler *pfh;
692 - struct fetch_resource_s *current, *next;
697 - (void) urlPath(u->url, &path);
698 - pfh = ne_propfind_create(u->sess, ctx->uri, depth);
700 - /* HACK: need to set RPMURL_SERVER_HASRANGE in u->allow here. */
702 - ctx->resrock = resrock;
703 - ctx->include_target = include_target;
705 - ne_xml_push_handler(ne_propfind_get_parser(pfh),
706 - fetch_startelm, NULL, NULL, pfh);
708 - ne_propfind_set_private(pfh, fetch_create_item, NULL);
710 - rc = ne_propfind_named(pfh, fetch_props, fetch_results, ctx);
712 - ne_propfind_destroy(pfh);
714 - for (current = resitem; current != NULL; current = next) {
715 - const char *s, *se;
718 - next = current->next;
720 - /* Collections have trailing '/' that needs trim. */
721 - /* The top level collection is returned as well. */
722 - se = current->uri + strlen(current->uri);
723 - if (se[-1] == '/') {
724 - if (strlen(current->uri) <= strlen(path)) {
725 - current = fetch_destroy_item(current);
731 - while (s > current->uri && s[-1] != '/')
734 - val = ne_strndup(s, (se - s));
737 - val = ne_path_unescape(val);
740 - xx = argvAdd(&ctx->av, val);
742 -fprintf(stderr, "*** argvAdd(%p,\"%s\")\n", &ctx->av, val);
745 - while (ctx->ac >= ctx->nalloced) {
746 - if (ctx->nalloced <= 0)
748 - ctx->nalloced *= 2;
749 - ctx->modes = xrealloc(ctx->modes,
750 - (sizeof(*ctx->modes) * ctx->nalloced));
751 - ctx->sizes = xrealloc(ctx->sizes,
752 - (sizeof(*ctx->sizes) * ctx->nalloced));
753 - ctx->mtimes = xrealloc(ctx->mtimes,
754 - (sizeof(*ctx->mtimes) * ctx->nalloced));
757 - switch (current->type) {
760 - /*@switchbreak@*/ break;
761 - case resr_collection:
763 - /*@switchbreak@*/ break;
764 - case resr_reference:
768 - /*@switchbreak@*/ break;
771 - ctx->modes[ctx->ac] = st_mode;
772 - ctx->sizes[ctx->ac] = current->size;
773 - ctx->mtimes[ctx->ac] = current->modtime;
777 - current = fetch_destroy_item(current);
779 - ctx->resrock = NULL; /* HACK: avoid leaving stack reference. */
780 - /* HACK realloc to truncate modes/sizes/mtimes */
785 -/* HACK this should be rewritten to use davReq/davResp w callbacks. */
786 -static int davHEAD(urlinfo u, struct stat *st)
787 - /*@modifies *st @*/
791 - const char *value = NULL;
794 - st->st_mode = S_IFREG;
795 - st->st_blksize = 4 * 1024; /* HACK correct for linux ext */
801 - req = ne_request_create(u->sess, "HEAD", u->url);
803 - rc = ne_request_dispatch(req);
809 - if (ne_get_status(req)->klass != 2) {
818 - value = ne_get_response_header(req, htag);
820 - /* inode-size-mtime */
824 - htag = "Content-Length";
825 -#if defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
826 - value = ne_get_response_header(req, htag);
829 - st->st_size = strtoll(value, NULL, 10);
830 - st->st_blocks = (st->st_size + 511)/512;
833 - htag = "Last-Modified";
834 -#if defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
835 - value = ne_get_response_header(req, htag);
838 - st->st_mtime = ne_httpdate_parse(value);
839 - st->st_atime = st->st_ctime = st->st_mtime; /* HACK */
843 - ne_request_destroy(req);
847 -static int davNLST(struct fetch_context_s * ctx)
848 - /*@globals internalState @*/
849 - /*@modifies ctx, internalState @*/
855 - rc = davInit(ctx->uri, &u);
856 - if (rc || u == NULL)
859 -/* HACK do PROPFIND through davFetch iff enabled, otherwise HEAD Content-length/ETag/Last-Modified */
860 - if (u->allow & RPMURL_SERVER_HASDAV)
861 - rc = davFetch(u, ctx); /* use PROPFIND to get contentLength */
863 - rc = davHEAD(u, ctx->st); /* use HEAD to get contentLength */
869 - /* HACK: "405 Method Not Allowed" for PROPFIND on non-DAV servers. */
870 - /* XXX #206066 OPTIONS is ok, but PROPFIND from Stat() fails. */
871 - /* rpm -qp --rpmiodebug --davdebug http://people.freedesktop.org/~sandmann/metacity-2.16.0-2.fc6/i386/metacity-2.16.0-2.fc6.i386.rpm */
872 - /* HACK: "301 Moved Permanently" on empty subdir. */
873 - if (!strncmp("301 ", ne_get_error(u->sess), sizeof("301 ")-1))
878 -fprintf(stderr, "*** Fetch from %s:%d failed:\n\t%s\n",
879 - u->host, u->port, ne_get_error(u->sess));
888 -/* =============================================================== */
889 -static int my_result(const char * msg, int ret, /*@null@*/ FILE * fp)
890 - /*@modifies *fp @*/
892 - /* HACK: don't print unless debugging. */
893 - if (_dav_debug >= 0)
898 - fprintf(fp, "*** %s: ", msg);
900 - /* HACK FTPERR_NE_FOO == -NE_FOO error impedance match */
902 - fprintf(fp, "%s: %s\n", ftpStrerror(-ret), ne_get_error(sess));
904 - fprintf(fp, "%s\n", ftpStrerror(-ret));
910 -static void hexdump(const unsigned char * buf, ssize_t len)
916 - for (i = 0; i < len; i++) {
917 - if (i != 0 && (i%16) == 0)
918 - fprintf(stderr, "\n");
919 - fprintf(stderr, " %02X", buf[i]);
921 - fprintf(stderr, "\n");
926 -static void davAcceptRanges(void * userdata, /*@null@*/ const char * value)
927 - /*@modifies userdata @*/
929 - urlinfo u = userdata;
931 - if (!(u != NULL && value != NULL)) return;
933 -fprintf(stderr, "*** u %p Accept-Ranges: %s\n", u, value);
934 - if (!strcmp(value, "bytes"))
935 - u->allow |= RPMURL_SERVER_HASRANGE;
936 - if (!strcmp(value, "none"))
937 - u->allow &= ~RPMURL_SERVER_HASRANGE;
941 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
942 -static void davAllHeaders(void * userdata, const char * value)
944 - FD_t ctrl = userdata;
946 - if (!(ctrl != NULL && value != NULL)) return;
948 -fprintf(stderr, "<- %s\n", value);
953 -static void davContentLength(void * userdata, /*@null@*/ const char * value)
954 - /*@modifies userdata @*/
956 - FD_t ctrl = userdata;
958 - if (!(ctrl != NULL && value != NULL)) return;
960 -fprintf(stderr, "*** fd %p Content-Length: %s\n", ctrl, value);
962 - ctrl->contentLength = strtoll(value, NULL, 10);
968 -static void davConnection(void * userdata, /*@null@*/ const char * value)
969 - /*@modifies userdata @*/
971 - FD_t ctrl = userdata;
973 - if (!(ctrl != NULL && value != NULL)) return;
975 -fprintf(stderr, "*** fd %p Connection: %s\n", ctrl, value);
976 - if (!strcasecmp(value, "close"))
978 - else if (!strcasecmp(value, "Keep-Alive"))
983 -/*@-mustmod@*/ /* HACK: stash error in *str. */
984 -int davResp(urlinfo u, FD_t ctrl, /*@unused@*/ char *const * str)
988 - rc = ne_begin_request(ctrl->req);
989 - rc = my_result("ne_begin_req(ctrl->req)", rc, NULL);
992 -fprintf(stderr, "*** davResp(%p,%p,%p) sess %p req %p rc %d\n", u, ctrl, str, u->sess, ctrl->req, rc);
994 - /* HACK FTPERR_NE_FOO == -NE_FOO error impedance match */
995 -/*@-observertrans@*/
997 - fdSetSyserrno(ctrl, errno, ftpStrerror(-rc));
998 -/*@=observertrans@*/
1004 -int davReq(FD_t ctrl, const char * httpCmd, const char * httpArg)
1009 -assert(ctrl != NULL);
1013 -if (_dav_debug < 0)
1014 -fprintf(stderr, "*** davReq(%p,%s,\"%s\") entry sess %p req %p\n", ctrl, httpCmd, (httpArg ? httpArg : ""), u->sess, ctrl->req);
1016 - ctrl->persist = (u->httpVersion > 0 ? 1 : 0);
1017 - ctrl = fdLink(ctrl, "open ctrl (davReq)");
1019 -assert(u->sess != NULL);
1020 -assert(ctrl->req == NULL);
1022 - ctrl->req = ne_request_create(u->sess, httpCmd, httpArg);
1024 -assert(ctrl->req != NULL);
1026 - ne_set_request_private(ctrl->req, "fd", ctrl);
1028 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
1029 - ne_add_response_header_catcher(ctrl->req, davAllHeaders, ctrl);
1031 - ne_add_response_header_handler(ctrl->req, "Content-Length",
1032 - davContentLength, ctrl);
1033 - ne_add_response_header_handler(ctrl->req, "Connection",
1034 - davConnection, ctrl);
1037 - if (!strcmp(httpCmd, "PUT")) {
1038 -#if defined(HAVE_NEON_NE_SEND_REQUEST_CHUNK)
1039 - ctrl->wr_chunked = 1;
1040 - ne_add_request_header(ctrl->req, "Transfer-Encoding", "chunked");
1041 - ne_set_request_chunked(ctrl->req, 1);
1042 - /* HACK: no retries if/when chunking. */
1043 - rc = davResp(u, ctrl, NULL);
1045 - rc = FTPERR_SERVER_IO_ERROR;
1048 - /* HACK: possible Last-Modified: Tue, 02 Nov 2004 14:29:36 GMT */
1049 - /* HACK: possible ETag: "inode-size-mtime" */
1050 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
1051 - ne_add_response_header_handler(ctrl->req, "Accept-Ranges",
1052 - davAcceptRanges, u);
1054 - /* HACK: possible Transfer-Encoding: on GET. */
1056 - /* HACK: other errors may need retry too. */
1057 - /* HACK: neon retries once, gud enuf. */
1058 - /* HACK: retry counter? */
1060 - rc = davResp(u, ctrl, NULL);
1061 - } while (rc == NE_RETRY);
1066 -if (_dav_debug < 0)
1067 -fprintf(stderr, "*** davReq(%p,%s,\"%s\") exit sess %p req %p rc %d\n", ctrl, httpCmd, (httpArg ? httpArg : ""), u->sess, ctrl->req, rc);
1069 -#if defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
1070 - davContentLength(ctrl,
1071 - ne_get_response_header(ctrl->req, "Content-Length"));
1072 - davConnection(ctrl,
1073 - ne_get_response_header(ctrl->req, "Connection"));
1074 - if (strcmp(httpCmd, "PUT"))
1075 - davAcceptRanges(u,
1076 - ne_get_response_header(ctrl->req, "Accept-Ranges"));
1079 - ctrl = fdLink(ctrl, "open data (davReq)");
1083 -/*@-observertrans@*/
1084 - fdSetSyserrno(ctrl, errno, ftpStrerror(rc));
1085 -/*@=observertrans@*/
1087 - /* HACK balance fd refs. ne_session_destroy to tear down non-keepalive? */
1088 - ctrl = fdLink(ctrl, "error data (davReq)");
1093 -FD_t davOpen(const char * url, /*@unused@*/ int flags,
1094 - /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
1096 - const char * path = NULL;
1097 - urltype urlType = urlPath(url, &path);
1102 -#if 0 /* XXX makeTempFile() heartburn */
1103 - assert(!(flags & O_RDWR));
1106 -if (_dav_debug < 0)
1107 -fprintf(stderr, "*** davOpen(%s,0x%x,0%o,%p)\n", url, flags, mode, uret);
1108 - rc = davInit(url, &u);
1109 - if (rc || u == NULL || u->sess == NULL)
1112 - if (u->ctrl == NULL)
1113 - u->ctrl = fdNew("persist ctrl (davOpen)");
1114 - if (u->ctrl->nrefs > 2 && u->data == NULL)
1115 - u->data = fdNew("persist data (davOpen)");
1117 - if (u->ctrl->url == NULL)
1118 - fd = fdLink(u->ctrl, "grab ctrl (davOpen persist ctrl)");
1119 - else if (u->data->url == NULL)
1120 - fd = fdLink(u->data, "grab ctrl (davOpen persist data)");
1122 - fd = fdNew("grab ctrl (davOpen)");
1125 - fdSetOpen(fd, url, flags, mode);
1126 - fdSetIo(fd, ufdio);
1128 - fd->ftpFileDoneNeeded = 0;
1129 - fd->rd_timeoutsecs = httpTimeoutSecs;
1130 - fd->contentLength = fd->bytesRemain = -1;
1131 - fd->url = urlLink(u, "url (davOpen)");
1132 - fd = fdLink(fd, "grab data (davOpen)");
1133 -assert(urlType == URL_IS_HTTPS || urlType == URL_IS_HTTP || urlType == URL_IS_HKP);
1134 - fd->urlType = urlType;
1142 - /*@-refcounttrans@*/
1144 - /*@=refcounttrans@*/
1147 -ssize_t davRead(void * cookie, /*@out@*/ char * buf, size_t count)
1153 -assert(count >= 128); /* HACK: see ne_request.h comment */
1155 - rc = ne_read_response_block(fd->req, buf, count);
1157 -if (_dav_debug < 0) {
1158 -fprintf(stderr, "*** davRead(%p,%p,0x%x) rc 0x%x\n", cookie, buf, (unsigned)count, (unsigned)rc);
1167 -ssize_t davWrite(void * cookie, const char * buf, size_t count)
1173 -#if !defined(NEONBLOWSCHUNKS)
1174 - ne_session * sess;
1176 -assert(fd->req != NULL);
1177 - sess = ne_get_session(fd->req);
1178 -assert(sess != NULL);
1180 - /* HACK: include ne_private.h to access sess->socket for now. */
1181 - xx = ne_sock_fullwrite(sess->socket, buf, count);
1183 -#if defined(HAVE_NEON_NE_SEND_REQUEST_CHUNK) || defined(__LCLINT__)
1184 -assert(fd->req != NULL);
1185 - xx = ne_send_request_chunk(fd->req, buf, count);
1187 - errno = EIO; /* HACK */
1192 - /* HACK: stupid error impedence matching. */
1193 - rc = (xx == 0 ? count : -1);
1195 -if (_dav_debug < 0)
1196 -fprintf(stderr, "*** davWrite(%p,%p,0x%x) rc 0x%x\n", cookie, buf, (unsigned)count, (unsigned)rc);
1199 -hexdump(buf, count);
1205 -int davSeek(void * cookie, /*@unused@*/ _libio_pos_t pos, int whence)
1207 -if (_dav_debug < 0)
1208 -fprintf(stderr, "*** davSeek(%p,pos,%d)\n", cookie, whence);
1212 -/*@-mustmod@*/ /* HACK: fd->req is modified. */
1213 -int davClose(void * cookie)
1220 -assert(fd->req != NULL);
1221 - rc = ne_end_request(fd->req);
1222 - rc = my_result("ne_end_request(req)", rc, NULL);
1224 - ne_request_destroy(fd->req);
1227 -if (_dav_debug < 0)
1228 -fprintf(stderr, "*** davClose(%p) rc %d\n", fd, rc);
1233 -/* =============================================================== */
1234 -int davMkdir(const char * path, mode_t mode)
1237 - const char * src = NULL;
1240 - rc = davInit(path, &u);
1244 - (void) urlPath(path, &src);
1246 - rc = ne_mkcol(u->sess, path);
1248 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1250 - /* XXX HACK: verify getrestype(remote) == resr_collection */
1254 -fprintf(stderr, "*** davMkdir(%s,0%o) rc %d\n", path, mode, rc);
1258 -int davRmdir(const char * path)
1261 - const char * src = NULL;
1264 - rc = davInit(path, &u);
1268 - (void) urlPath(path, &src);
1270 - /* XXX HACK: only getrestype(remote) == resr_collection */
1272 - rc = ne_delete(u->sess, path);
1274 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1278 -fprintf(stderr, "*** davRmdir(%s) rc %d\n", path, rc);
1282 -int davRename(const char * oldpath, const char * newpath)
1285 - const char * src = NULL;
1286 - const char * dst = NULL;
1287 - int overwrite = 1; /* HACK: set this correctly. */
1290 - rc = davInit(oldpath, &u);
1294 - (void) urlPath(oldpath, &src);
1295 - (void) urlPath(newpath, &dst);
1297 - /* XXX HACK: only getrestype(remote) != resr_collection */
1299 - rc = ne_move(u->sess, overwrite, src, dst);
1301 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1305 -fprintf(stderr, "*** davRename(%s,%s) rc %d\n", oldpath, newpath, rc);
1309 -int davUnlink(const char * path)
1312 - const char * src = NULL;
1315 - rc = davInit(path, &u);
1319 - (void) urlPath(path, &src);
1321 - /* XXX HACK: only getrestype(remote) != resr_collection */
1323 - rc = ne_delete(u->sess, src);
1326 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1329 -fprintf(stderr, "*** davUnlink(%s) rc %d\n", path, rc);
1334 -static int davChdir(const char * path)
1335 - /*@globals h_errno, fileSystem, internalState @*/
1336 - /*@modifies fileSystem, internalState @*/
1338 - return davCommand("CWD", path, NULL);
1340 -#endif /* NOTYET */
1342 -/* =============================================================== */
1344 -static const char * statstr(const struct stat * st,
1345 - /*@returned@*/ /*@out@*/ char * buf)
1346 - /*@modifies *buf @*/
1349 - "*** dev %x ino %x mode %0o nlink %d uid %d gid %d rdev %x size %x\n",
1350 - (unsigned)st->st_dev,
1351 - (unsigned)st->st_ino,
1353 - (unsigned)st->st_nlink,
1356 - (unsigned)st->st_rdev,
1357 - (unsigned)st->st_size);
1362 -static int dav_st_ino = 0xdead0000;
1365 -int davStat(const char * path, /*@out@*/ struct stat *st)
1366 - /*@globals dav_st_ino, fileSystem, internalState @*/
1367 - /*@modifies *st, dav_st_ino, fileSystem, internalState @*/
1369 - struct fetch_context_s * ctx = NULL;
1373 -/* HACK: neon really wants collections with trailing '/' */
1374 - ctx = fetch_create_context(path, st);
1375 - if (ctx == NULL) {
1376 -fprintf(stderr, "==> %s fetch_create_context ctx %p\n", __FUNCTION__, ctx);
1377 -/* HACK: errno = ??? */
1380 - rc = davNLST(ctx);
1382 -/* HACK: errno = ??? */
1386 - if (st->st_mode == 0)
1387 - st->st_mode = (ctx->ac > 1 ? S_IFDIR : S_IFREG);
1388 - st->st_size = (ctx->sizes ? ctx->sizes[0] : st->st_size);
1389 - st->st_mtime = (ctx->mtimes ? ctx->mtimes[0] : st->st_mtime);
1390 - st->st_atime = st->st_ctime = st->st_mtime; /* HACK */
1391 - if (S_ISDIR(st->st_mode)) {
1393 - st->st_mode |= 0755;
1395 - if (S_ISREG(st->st_mode)) {
1397 - st->st_mode |= 0644;
1400 - /* XXX fts(3) needs/uses st_ino, make something up for now. */
1401 - if (st->st_ino == 0)
1402 - st->st_ino = dav_st_ino++;
1405 -if (_dav_debug < 0)
1406 -fprintf(stderr, "*** davStat(%s) rc %d\n%s", path, rc, statstr(st, buf));
1407 - ctx = fetch_destroy_context(ctx);
1413 -int davLstat(const char * path, /*@out@*/ struct stat *st)
1414 - /*@globals dav_st_ino, fileSystem, internalState @*/
1415 - /*@modifies *st, dav_st_ino, fileSystem, internalState @*/
1417 - struct fetch_context_s * ctx = NULL;
1421 -/* HACK: neon really wants collections with trailing '/' */
1422 - ctx = fetch_create_context(path, st);
1423 - if (ctx == NULL) {
1424 -/* HACK: errno = ??? */
1427 - rc = davNLST(ctx);
1429 -/* HACK: errno = ??? */
1433 - if (st->st_mode == 0)
1434 - st->st_mode = (ctx->ac > 1 ? S_IFDIR : S_IFREG);
1435 - st->st_size = (ctx->sizes ? ctx->sizes[0] : st->st_size);
1436 - st->st_mtime = (ctx->mtimes ? ctx->mtimes[0] : st->st_mtime);
1437 - st->st_atime = st->st_ctime = st->st_mtime; /* HACK */
1438 - if (S_ISDIR(st->st_mode)) {
1440 - st->st_mode |= 0755;
1442 - if (S_ISREG(st->st_mode)) {
1444 - st->st_mode |= 0644;
1447 - /* XXX fts(3) needs/uses st_ino, make something up for now. */
1448 - if (st->st_ino == 0)
1449 - st->st_ino = dav_st_ino++;
1450 -if (_dav_debug < 0)
1451 -fprintf(stderr, "*** davLstat(%s) rc %d\n%s\n", path, rc, statstr(st, buf));
1453 - ctx = fetch_destroy_context(ctx);
1459 -static int davReadlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
1460 - /*@globals h_errno, fileSystem, internalState @*/
1461 - /*@modifies *buf, fileSystem, internalState @*/
1464 - rc = davNLST(path, DO_FTP_READLINK, NULL, buf, bufsiz);
1465 -if (_dav_debug < 0)
1466 -fprintf(stderr, "*** davReadlink(%s) rc %d\n", path, rc);
1469 -#endif /* NOTYET */
1471 -/* =============================================================== */
1473 int avmagicdir = 0x3607113;
1475 @@ -1625,171 +167,3 @@
1479 -/* =============================================================== */
1481 -int davmagicdir = 0x8440291;
1483 -int davClosedir(/*@only@*/ DIR * dir)
1485 - DAVDIR avdir = (DAVDIR)dir;
1487 -if (_dav_debug < 0)
1488 -fprintf(stderr, "*** davClosedir(%p)\n", avdir);
1490 -#if defined(HAVE_PTHREAD_H)
1491 -/*@-moduncon -noeffectuncon @*/
1492 - (void) pthread_mutex_destroy(&avdir->lock);
1493 -/*@=moduncon =noeffectuncon @*/
1496 - avdir = _free(avdir);
1500 -struct dirent * davReaddir(DIR * dir)
1502 - DAVDIR avdir = (DAVDIR)dir;
1503 - struct dirent * dp;
1505 - unsigned char * dt;
1509 - if (avdir == NULL || !ISDAVMAGIC(avdir) || avdir->data == NULL) {
1510 - /* XXX TODO: EBADF errno. */
1514 - dp = (struct dirent *) avdir->data;
1515 - av = (const char **) (dp + 1);
1517 - dt = (char *) (av + (ac + 1));
1518 - i = avdir->offset + 1;
1521 - if (i < 0 || i >= ac || av[i] == NULL)
1525 - avdir->offset = i;
1527 - /* XXX glob(3) uses REAL_DIR_ENTRY(dp) test on d_ino */
1529 - dp->d_ino = i + 1; /* W2DO? */
1530 - dp->d_reclen = 0; /* W2DO? */
1532 -#if !(defined(hpux) || defined(__hpux) || defined(sun))
1533 -#if !defined(__APPLE__) && !defined(__FreeBSD_kernel__)
1534 - dp->d_off = 0; /* W2DO? */
1537 - dp->d_type = dt[i];
1542 - strncpy(dp->d_name, av[i], sizeof(dp->d_name));
1543 -if (_dav_debug < 0)
1544 -fprintf(stderr, "*** davReaddir(%p) %p \"%s\"\n", (void *)avdir, dp, dp->d_name);
1550 -DIR * davOpendir(const char * path)
1552 - struct fetch_context_s * ctx;
1554 - struct dirent * dp;
1556 - const char ** av, ** nav;
1557 - unsigned char * dt;
1562 - /* HACK: glob does not pass dirs with trailing '/' */
1563 - nb = strlen(path)+1;
1565 - if (path[nb-1] != '/') {
1566 - char * npath = alloca(nb+1);
1568 - (void) stpcpy( stpcpy(npath, path), "/");
1573 -if (_dav_debug < 0)
1574 -fprintf(stderr, "*** davOpendir(%s)\n", path);
1576 - /* Load DAV collection into argv. */
1577 - ctx = fetch_create_context(path, NULL);
1578 - if (ctx == NULL) {
1579 -/* HACK: errno = ??? */
1582 - rc = davNLST(ctx);
1584 -/* HACK: errno = ??? */
1592 - while (av[ac] != NULL)
1593 - nb += strlen(av[ac++]) + 1;
1594 - ac += 2; /* for "." and ".." */
1595 - nb += sizeof(".") + sizeof("..");
1597 - nb += sizeof(*avdir) + sizeof(*dp) + ((ac + 1) * sizeof(*av)) + (ac + 1);
1598 - avdir = xcalloc(1, nb);
1600 - dp = (struct dirent *) (avdir + 1);
1601 - nav = (const char **) (dp + 1);
1602 - dt = (char *) (nav + (ac + 1));
1603 - t = (char *) (dt + ac + 1);
1606 - avdir->fd = davmagicdir;
1608 - avdir->data = (char *) dp;
1610 - avdir->allocation = nb;
1612 - avdir->offset = -1;
1613 - avdir->filepos = 0;
1615 -#if defined(HAVE_PTHREAD_H)
1616 -/*@-moduncon -noeffectuncon -nullpass @*/
1617 - (void) pthread_mutex_init(&avdir->lock, NULL);
1618 -/*@=moduncon =noeffectuncon =nullpass @*/
1622 -/*@-dependenttrans -unrecog@*/
1623 - dt[nac] = DT_DIR; nav[nac++] = t; t = stpcpy(t, "."); t++;
1624 - dt[nac] = DT_DIR; nav[nac++] = t; t = stpcpy(t, ".."); t++;
1625 -/*@=dependenttrans =unrecog@*/
1627 - /* Copy DAV items into DIR elments. */
1630 - while (av[ac] != NULL) {
1632 - dt[nac] = (S_ISDIR(ctx->modes[ac]) ? DT_DIR : DT_REG);
1633 - t = stpcpy(t, av[ac]);
1640 - ctx = fetch_destroy_context(ctx);
1643 - return (DIR *) avdir;
1647 diff -ur rpm-4.4.7.org/rpmio/rpmdav.h rpm-4.4.7/rpmio/rpmdav.h
1648 --- rpm-4.4.7.org/rpmio/rpmdav.h 2005-10-11 21:13:59.000000000 +0200
1649 +++ rpm-4.4.7/rpmio/rpmdav.h 2006-10-17 22:35:33.742783250 +0200
1651 extern int avmagicdir;
1652 #define ISAVMAGIC(_dir) (!memcmp((_dir), &avmagicdir, sizeof(avmagicdir)))
1657 -extern int davmagicdir;
1658 -#define ISDAVMAGIC(_dir) (!memcmp((_dir), &davmagicdir, sizeof(davmagicdir)))
1664 /*@globals fileSystem, internalState @*/
1665 /*@modifies fileSystem, internalState @*/;
1668 - * Send a http request.
1670 - * @param httpCmd http command
1671 - * @param httpArg http command argument (NULL if none)
1672 - * @returns 0 on success
1674 -int davReq(FD_t ctrl, const char * httpCmd, /*@null@*/ const char * httpArg)
1675 - /*@globals fileSystem, internalState @*/
1676 - /*@modifies ctrl, fileSystem, internalState @*/;
1679 - * Read a http response.
1682 - * @retval *str error msg
1683 - * @returns 0 on success
1686 -int davResp(urlinfo u, FD_t ctrl, /*@out@*/ /*@null@*/ char *const * str)
1687 - /*@globals fileSystem, internalState @*/
1688 - /*@modifies ctrl, *str, fileSystem, internalState @*/;
1694 -FD_t davOpen(const char * url, /*@unused@*/ int flags,
1695 - /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
1696 - /*@globals internalState @*/
1697 - /*@modifies *uret, internalState @*/;
1702 -ssize_t davRead(void * cookie, /*@out@*/ char * buf, size_t count)
1703 - /*@globals fileSystem, internalState @*/
1704 - /*@modifies buf, fileSystem, internalState @*/
1705 - /*@requires maxSet(buf) >= (count - 1) @*/
1706 - /*@ensures maxRead(buf) == result @*/;
1711 -ssize_t davWrite(void * cookie, const char * buf, size_t count)
1712 - /*@globals fileSystem, internalState @*/
1713 - /*@modifies fileSystem, internalState @*/;
1717 -int davSeek(void * cookie, _libio_pos_t pos, int whence)
1718 - /*@globals fileSystem, internalState @*/
1719 - /*@modifies fileSystem, internalState @*/;
1723 -int davClose(void * cookie)
1724 - /*@globals fileSystem, internalState @*/
1725 - /*@modifies cookie, fileSystem, internalState @*/;
1729 -int davMkdir(const char * path, mode_t mode)
1730 - /*@globals fileSystem, internalState @*/
1731 - /*@modifies fileSystem, internalState @*/;
1735 -int davRmdir(const char * path)
1736 - /*@globals fileSystem, internalState @*/
1737 - /*@modifies fileSystem, internalState @*/;
1741 -int davRename(const char * oldpath, const char * newpath)
1742 - /*@globals fileSystem, internalState @*/
1743 - /*@modifies fileSystem, internalState @*/;
1747 -int davUnlink(const char * path)
1748 - /*@globals fileSystem, internalState @*/
1749 - /*@modifies fileSystem, internalState @*/;
1752 - * Close a DAV collection.
1753 - * @param dir argv DIR
1754 - * @return 0 always
1756 -int davClosedir(/*@only@*/ DIR * dir)
1757 - /*@globals fileSystem @*/
1758 - /*@modifies dir, fileSystem @*/;
1761 - * Return next entry from a DAV collection.
1762 - * @param dir argv DIR
1763 - * @return next entry
1765 -/*@dependent@*/ /*@null@*/
1766 -struct dirent * davReaddir(DIR * dir)
1767 - /*@globals fileSystem @*/
1768 - /*@modifies fileSystem @*/;
1771 - * Create an argv directory from DAV collection.
1772 - * @param path URL for DAV collection path
1773 - * @return argv DIR
1776 -DIR * davOpendir(const char * path)
1777 - /*@globals fileSystem, internalState @*/
1778 - /*@modifies fileSystem, internalState @*/;
1783 -int davStat(const char * path, /*@out@*/ struct stat * st)
1784 - /*@globals fileSystem, internalState @*/
1785 - /*@modifies *st, fileSystem, internalState @*/;
1790 -int davLstat(const char * path, /*@out@*/ struct stat * st)
1791 - /*@globals fileSystem, internalState @*/
1792 - /*@modifies *st, fileSystem, internalState @*/;
1797 diff -ur rpm-4.4.7.org/rpmio/rpmio.c rpm-4.4.7/rpmio/rpmio.c
1798 --- rpm-4.4.7.org/rpmio/rpmio.c 2006-08-08 08:55:01.000000000 +0200
1799 +++ rpm-4.4.7/rpmio/rpmio.c 2006-10-17 22:18:38.135311750 +0200
1800 @@ -406,13 +406,6 @@
1802 fdstat_enter(fd, FDSTAT_READ);
1804 - /* HACK: flimsy wiring for davRead */
1805 - if (fd->req != NULL) {
1806 - rc = davRead(fd, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1807 - /* XXX Chunked davRead EOF. */
1809 - fd->bytesRemain = 0;
1811 rc = read(fdFileno(fd), buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1813 fdstat_exit(fd, FDSTAT_READ, rc);
1814 @@ -440,10 +433,6 @@
1816 fdstat_enter(fd, FDSTAT_WRITE);
1818 - /* HACK: flimsy wiring for davWrite */
1819 - if (fd->req != NULL)
1820 - rc = davWrite(fd, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1822 rc = write(fdno, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1824 fdstat_exit(fd, FDSTAT_WRITE, rc);
1825 @@ -490,11 +479,6 @@
1828 fdstat_enter(fd, FDSTAT_CLOSE);
1829 - /* HACK: flimsy wiring for davClose */
1831 - if (fd->req != NULL)
1832 - rc = davClose(fd);
1834 rc = ((fdno >= 0) ? close(fdno) : -2);
1836 fdstat_exit(fd, FDSTAT_CLOSE, rc);
1837 @@ -547,10 +531,6 @@
1841 - /* HACK: flimsy wiring for davWrite */
1842 - if (fd->req != NULL)
1845 if ((fdno = fdFileno(fd)) < 0)
1846 return -1; /* XXX W2DO? */
1848 @@ -602,10 +582,6 @@
1852 - /* HACK: flimsy wiring for davRead */
1853 - if (fd->req != NULL)
1856 if ((fdno = fdFileno(fd)) < 0)
1857 return -1; /* XXX W2DO? */
1859 @@ -1758,159 +1734,6 @@
1864 -static int httpResp(urlinfo u, FD_t ctrl, /*@out@*/ char ** str)
1865 - /*@globals fileSystem @*/
1866 - /*@modifies ctrl, *str, fileSystem @*/
1872 - rc = checkResponse(u, ctrl, &ec, str);
1874 -if (_ftp_debug && !(rc == 0 && (ec == 200 || ec == 201)))
1875 -fprintf(stderr, "*** httpResp: rc %d ec %d\n", rc, ec);
1879 - case 201: /* 201 Created. */
1881 - case 204: /* HACK: if overwriting, 204 No Content. */
1882 - case 403: /* 403 Forbidden. */
1883 - ctrl->syserrno = EACCES; /* HACK */
1884 - rc = FTPERR_UNKNOWN;
1887 - rc = FTPERR_FILE_NOT_FOUND;
1893 -static int httpReq(FD_t ctrl, const char * httpCmd, const char * httpArg)
1894 - /*@globals h_errno, fileSystem, internalState @*/
1895 - /*@modifies ctrl, fileSystem, internalState @*/
1898 - const char * host;
1899 - const char * path;
1900 - char hthost[NI_MAXHOST];
1907 -assert(ctrl != NULL);
1911 - if (((host = (u->proxyh ? u->proxyh : u->host)) == NULL))
1912 - return FTPERR_BAD_HOSTNAME;
1913 - if (strchr(host, ':'))
1914 - sprintf(hthost, "[%s]", host);
1916 - strcpy(hthost, host);
1918 - if ((port = (u->proxyp > 0 ? u->proxyp : u->port)) < 0) port = 80;
1919 - path = (u->proxyh || u->proxyp > 0) ? u->url : httpArg;
1920 - /*@-branchstate@*/
1921 - if (path == NULL) path = "";
1922 - /*@=branchstate@*/
1925 - /*@-branchstate@*/
1926 - if (fdFileno(ctrl) >= 0 && (rc = fdWritable(ctrl, 0)) < 1) {
1927 - /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
1929 - /*@=branchstate@*/
1932 - if (fdFileno(ctrl) < 0) {
1933 - rc = tcpConnect(ctrl, host, port);
1936 - ctrl = fdLink(ctrl, "open ctrl (httpReq)");
1940 -req x HTTP/1.0\r\n\
1941 -User-Agent: rpm/3.0.4\r\n\
1943 -Accept: text/plain\r\n\
1944 -Transfer-Encoding: chunked\r\n\
1946 -") + strlen(httpCmd) + strlen(path) + sizeof(VERSION) + strlen(hthost) + 20;
1949 - req = alloca(len);
1952 - if (!strcmp(httpCmd, "PUT")) {
1954 -%s %s HTTP/1.%d\r\n\
1955 -User-Agent: rpm/%s\r\n\
1957 -Accept: text/plain\r\n\
1958 -Transfer-Encoding: chunked\r\n\
1960 -", httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, hthost, port);
1963 -%s %s HTTP/1.%d\r\n\
1964 -User-Agent: rpm/%s\r\n\
1966 -Accept: text/plain\r\n\
1968 -", httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, hthost, port);
1973 -fprintf(stderr, "-> %s", req);
1975 - len = strlen(req);
1976 - if (fdWrite(ctrl, req, len) != len) {
1977 - rc = FTPERR_SERVER_IO_ERROR;
1981 - /*@-branchstate@*/
1982 - if (!strcmp(httpCmd, "PUT")) {
1983 - ctrl->wr_chunked = 1;
1986 - rc = httpResp(u, ctrl, NULL);
1989 - if (!retrying) { /* not HTTP_OK */
1991 - /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
1997 - /*@=branchstate@*/
1999 - ctrl = fdLink(ctrl, "open data (httpReq)");
2003 - /*@-observertrans@*/
2004 - fdSetSyserrno(ctrl, errno, ftpStrerror(rc));
2005 - /*@=observertrans@*/
2007 - /*@-branchstate@*/
2008 - if (fdFileno(ctrl) >= 0)
2009 - /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
2010 - /*@=branchstate@*/
2016 /* XXX DYING: unused */
2017 void * ufdGetUrlinfo(FD_t fd)
2019 @@ -2268,29 +2091,6 @@
2023 - case URL_IS_HTTPS:
2026 - fd = davOpen(url, flags, mode, &u);
2027 - if (fd == NULL || u == NULL)
2030 - cmd = ((flags & O_WRONLY)
2031 - ? ((flags & O_APPEND) ? "PUT" :
2032 - ((flags & O_CREAT) ? "PUT" : "PUT"))
2034 - u->openError = davReq(fd, cmd, path);
2035 - if (u->openError < 0) {
2036 - /* XXX make sure that we can exit through ufdClose */
2037 - fd = fdLink(fd, "error ctrl (ufdOpen HTTP)");
2038 - fd = fdLink(fd, "error data (ufdOpen HTTP)");
2040 - fd->bytesRemain = ((!strcmp(cmd, "GET"))
2041 - ? fd->contentLength : -1);
2042 - fd->wr_chunked = ((!strcmp(cmd, "PUT"))
2043 - ? fd->wr_chunked : 0);
2047 assert(!(flags & O_RDWR));
2048 fd = fdDup( ((flags & O_WRONLY) ? STDOUT_FILENO : STDIN_FILENO) );
2049 @@ -2908,10 +2708,8 @@
2050 if (fd->nfps > 0 && fpno == -1 &&
2051 fd->fps[fd->nfps-1].io == ufdio &&
2052 fd->fps[fd->nfps-1].fp == fp &&
2053 - (fd->fps[fd->nfps-1].fdno >= 0 || fd->req != NULL))
2054 + (fd->fps[fd->nfps-1].fdno >= 0))
2056 - int hadreqpersist = (fd->req != NULL);
2061 @@ -2921,26 +2719,9 @@
2063 if (fdGetFdno(fd) >= 0)
2066 - hadreqpersist = 0;
2070 - /* HACK: flimsy Keepalive wiring. */
2071 - if (hadreqpersist) {
2076 -/*@-refcounttrans@*/
2077 - (void) fdClose(fd);
2078 -/*@=refcounttrans@*/
2079 - fdSetFp(fd, NULL);
2081 -/*@-refcounttrans@*/
2082 - (void) fdClose(fd);
2083 -/*@=refcounttrans@*/
2088 @@ -3195,18 +2976,9 @@
2096 /* XXX gzdio and bzdio here too */
2098 switch (urlIsURL(path)) {
2099 - case URL_IS_HTTPS:
2107 @@ -3214,7 +2986,7 @@
2109 fprintf(stderr, "*** Fopen ufdio path %s fmode %s\n", path, fmode);
2110 fd = ufdOpen(path, flags, perms);
2111 - if (fd == NULL || !(fdFileno(fd) >= 0 || fd->req != NULL))
2112 + if (fd == NULL || !(fdFileno(fd) >= 0))
2116 @@ -3223,15 +2995,6 @@
2118 /*@notreached@*/ break;
2121 - /* XXX persistent HTTP/1.1 returns the previously opened fp */
2122 - if (isHTTP && ((fp = fdGetFp(fd)) != NULL) && ((fdno = fdGetFdno(fd)) >= 0 || fd->req != NULL))
2124 - /*@+voidabstract@*/
2125 - fdPush(fd, fpio, fp, fileno(fp)); /* Push fpio onto stack */
2126 - /*@=voidabstract@*/
2132 @@ -3267,10 +3030,6 @@
2135 if (fd == NULL) return -1;
2136 - if (fd->req != NULL) {
2137 - /* HACK: flimsy wiring for neon errors. */
2138 - rc = (fd->syserrno || fd->errcookie != NULL) ? -1 : 0;
2140 for (i = fd->nfps; rc == 0 && i >= 0; i--) {
2142 FDSTACK_t * fps = &fd->fps[i];
2143 @@ -3305,9 +3064,6 @@
2147 - if (fd->req != NULL)
2148 - rc = 123456789; /* HACK: https has no steenkin fileno. */
2150 for (i = fd->nfps ; rc == -1 && i >= 0; i--) {
2152 rc = fd->fps[i].fdno;
2153 diff -ur rpm-4.4.7.org/rpmio/rpmio_internal.h rpm-4.4.7/rpmio/rpmio_internal.h
2154 --- rpm-4.4.7.org/rpmio/rpmio_internal.h 2006-06-18 20:54:59.000000000 +0200
2155 +++ rpm-4.4.7/rpmio/rpmio_internal.h 2006-10-17 22:18:51.308135000 +0200
2158 void * url; /* ufdio: URL info */
2160 - void * req; /* ufdio: HTTP request */
2162 int rd_timeoutsecs; /* ufdRead: per FD_t timer */
2163 ssize_t bytesRemain; /* ufdio: */
2164 diff -ur rpm-4.4.7.org/rpmio/rpmrpc.c rpm-4.4.7/rpmio/rpmrpc.c
2165 --- rpm-4.4.7.org/rpmio/rpmrpc.c 2006-10-03 06:38:01.000000000 +0200
2166 +++ rpm-4.4.7/rpmio/rpmrpc.c 2006-10-17 22:35:59.040364250 +0200
2169 return ftpMkdir(path, mode);
2170 /*@notreached@*/ break;
2171 - case URL_IS_HTTPS:
2173 - return davMkdir(path, mode);
2174 - /*@notreached@*/ break;
2178 @@ -118,15 +114,6 @@
2180 return ftpChdir(path);
2181 /*@notreached@*/ break;
2182 - case URL_IS_HTTPS:
2185 - return davChdir(path);
2187 - errno = EINVAL; /* XXX W2DO? */
2190 - /*@notreached@*/ break;
2194 @@ -151,10 +138,6 @@
2196 return ftpRmdir(path);
2197 /*@notreached@*/ break;
2198 - case URL_IS_HTTPS:
2200 - return davRmdir(path);
2201 - /*@notreached@*/ break;
2208 case URL_IS_FTP: /* XXX TODO: implement. */
2209 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2210 - case URL_IS_HTTP: /* XXX TODO: implement. */
2212 errno = EINVAL; /* XXX W2DO? */
2214 @@ -208,10 +189,6 @@
2216 oldut = urlPath(oldpath, &oe);
2218 - case URL_IS_HTTPS:
2220 - return davRename(oldpath, newpath);
2221 - /*@notreached@*/ break;
2222 case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
2224 case URL_IS_UNKNOWN:
2227 return ftpRename(oldpath, newpath);
2228 /*@notreached@*/ break;
2229 - case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */
2230 - case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */
2236 oldut = urlPath(oldpath, &oe);
2238 - case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */
2239 - case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */
2240 case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
2242 case URL_IS_UNKNOWN:
2245 newut = urlPath(newpath, &ne);
2247 - case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */
2248 - case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */
2249 case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
2252 @@ -306,10 +277,6 @@
2254 return ftpUnlink(path);
2255 /*@notreached@*/ break;
2256 - case URL_IS_HTTPS:
2258 - return davUnlink(path);
2259 - /*@notreached@*/ break;
2263 @@ -1308,10 +1275,6 @@
2265 return ftpStat(path, st);
2266 /*@notreached@*/ break;
2267 - case URL_IS_HTTPS:
2269 - return davStat(path, st);
2270 - /*@notreached@*/ break;
2274 @@ -1338,10 +1301,6 @@
2276 return ftpLstat(path, st);
2277 /*@notreached@*/ break;
2278 - case URL_IS_HTTPS:
2280 - return davLstat(path, st);
2281 - /*@notreached@*/ break;
2285 @@ -1373,8 +1332,6 @@
2288 case URL_IS_FTP: /* XXX TODO: implement. */
2289 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2290 - case URL_IS_HTTP: /* XXX TODO: implement. */
2292 errno = EINVAL; /* XXX W2DO? */
2294 @@ -1399,8 +1356,6 @@
2297 case URL_IS_FTP: /* XXX TODO: implement. */
2298 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2299 - case URL_IS_HTTP: /* XXX TODO: implement. */
2301 errno = EINVAL; /* XXX W2DO? */
2303 @@ -1425,8 +1380,6 @@
2306 case URL_IS_FTP: /* XXX TODO: implement. */
2307 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2308 - case URL_IS_HTTP: /* XXX TODO: implement. */
2310 errno = EINVAL; /* XXX W2DO? */
2312 @@ -1451,8 +1404,6 @@
2315 case URL_IS_FTP: /* XXX TODO: implement. */
2316 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2317 - case URL_IS_HTTP: /* XXX TODO: implement. */
2319 errno = EINVAL; /* XXX W2DO? */
2321 @@ -1477,8 +1428,6 @@
2324 case URL_IS_FTP: /* XXX TODO: implement. */
2325 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2326 - case URL_IS_HTTP: /* XXX TODO: implement. */
2328 errno = EINVAL; /* XXX W2DO? */
2330 @@ -1503,8 +1452,6 @@
2333 case URL_IS_FTP: /* XXX TODO: implement. */
2334 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2335 - case URL_IS_HTTP: /* XXX TODO: implement. */
2337 errno = EINVAL; /* XXX W2DO? */
2339 @@ -1529,8 +1476,6 @@
2342 case URL_IS_FTP: /* XXX TODO: implement. */
2343 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2344 - case URL_IS_HTTP: /* XXX TODO: implement. */
2346 errno = EINVAL; /* XXX W2DO? */
2348 @@ -1558,8 +1503,6 @@
2351 case URL_IS_FTP: /* XXX TODO: implement. */
2352 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2353 - case URL_IS_HTTP: /* XXX TODO: implement. */
2355 errno = EINVAL; /* XXX W2DO? */
2357 @@ -1577,14 +1520,6 @@
2359 return ftpReadlink(path, buf, bufsiz);
2360 /*@notreached@*/ break;
2361 - case URL_IS_HTTPS:
2364 - return davReadlink(path, buf, bufsiz);
2368 - /*@notreached@*/ break;
2372 @@ -1617,8 +1552,6 @@
2376 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2377 - case URL_IS_HTTP: /* XXX TODO: implement. */
2378 case URL_IS_FTP: /* XXX TODO: implement. */
2380 errno = EINVAL; /* XXX W2DO? */
2381 @@ -1685,8 +1618,6 @@
2382 fprintf(stderr, "*** Glob(%s,0x%x,%p,%p)\n", pattern, (unsigned)flags, (void *)errfunc, pglob);
2385 - case URL_IS_HTTPS:
2389 pglob->gl_closedir = Closedir;
2390 @@ -1730,10 +1661,6 @@
2392 return ftpOpendir(path);
2393 /*@notreached@*/ break;
2394 - case URL_IS_HTTPS:
2396 - return davOpendir(path);
2397 - /*@notreached@*/ break;
2401 @@ -1758,8 +1685,6 @@
2404 return avReaddir(dir);
2405 - if (ISDAVMAGIC(dir))
2406 - return davReaddir(dir);
2407 return readdir(dir);
2410 @@ -1771,8 +1696,6 @@
2413 return avClosedir(dir);
2414 - if (ISDAVMAGIC(dir))
2415 - return davClosedir(dir);
2416 return closedir(dir);
2419 diff -ur rpm-4.4.7.org/rpmio/tget.c rpm-4.4.7/rpmio/tget.c
2420 --- rpm-4.4.7.org/rpmio/tget.c 2004-11-19 17:52:58.000000000 +0100
2421 +++ rpm-4.4.7/rpmio/tget.c 2006-10-17 22:20:47.995427500 +0200
2424 static int _debug = 0;
2428 #define HTTPSPATH "https://localhost/test.txt"
2429 #define HTTPPATH "http://localhost/test.txt"
2430 #define FTPPATH "ftp://localhost/test.txt"
2432 { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL },
2433 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2434 N_("debug protocol data stream"), NULL},
2435 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2436 - N_("disable use of libneon for HTTP"), NULL},
2437 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2438 N_("debug rpmio I/O"), NULL},
2439 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2440 diff -ur rpm-4.4.7.org/rpmio/tglob.c rpm-4.4.7/rpmio/tglob.c
2441 --- rpm-4.4.7.org/rpmio/tglob.c 2004-11-19 17:53:05.000000000 +0100
2442 +++ rpm-4.4.7/rpmio/tglob.c 2006-10-17 22:21:01.712284750 +0200
2445 static int _debug = 0;
2449 #define HTTPSPATH "https://localhost/rawhide/test/*.rpm"
2451 #define HTTPPATH "http://localhost/rawhide/test/*.rpm"
2453 { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL },
2454 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2455 N_("debug protocol data stream"), NULL},
2456 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2457 - N_("disable use of libneon for HTTP"), NULL},
2458 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2459 N_("debug rpmio I/O"), NULL},
2460 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2461 diff -ur rpm-4.4.7.org/rpmio/thkp.c rpm-4.4.7/rpmio/thkp.c
2462 --- rpm-4.4.7.org/rpmio/thkp.c 2005-01-04 17:35:12.000000000 +0100
2463 +++ rpm-4.4.7/rpmio/thkp.c 2006-10-17 22:21:10.696846250 +0200
2465 static int _debug = 0;
2466 static int _printing = 0;
2471 #define HKPPATH "hkp://pgp.mit.edu:11371/pks/lookup?op=get&search=0xF5C75256"
2474 N_("debug protocol data stream"), NULL},
2475 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2476 N_("debug protocol data stream"), NULL},
2477 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2478 - N_("disable use of libneon for HTTP"), NULL},
2479 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2480 N_("debug rpmio I/O"), NULL},
2481 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2482 diff -ur rpm-4.4.7.org/rpmio/tput.c rpm-4.4.7/rpmio/tput.c
2483 --- rpm-4.4.7.org/rpmio/tput.c 2004-11-19 17:53:11.000000000 +0100
2484 +++ rpm-4.4.7/rpmio/tput.c 2006-10-17 22:21:25.841792750 +0200
2487 static int _debug = 0;
2491 #define HTTPSPATH "https://localhost/rawhide/toad/tput.txt"
2492 #define HTTPPATH "http://localhost/rawhide/toad/tput.txt"
2493 #define FTPPATH "ftp://localhost/home/test/tput.txt"
2495 { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL },
2496 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2497 N_("debug protocol data stream"), NULL},
2498 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2499 - N_("disable use of libneon for HTTP"), NULL},
2500 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2501 N_("debug rpmio I/O"), NULL},
2502 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2503 --- rpm-4.4.8/rpmio/url.c.orig 2007-01-20 21:33:50.000000000 +0100
2504 +++ rpm-4.4.8/rpmio/url.c 2007-04-08 19:57:45.646376012 +0200
2507 { "file://", URL_IS_PATH },
2508 { "ftp://", URL_IS_FTP },
2509 - { "hkp://", URL_IS_HKP },
2510 - { "http://", URL_IS_HTTP },
2511 - { "https://", URL_IS_HTTPS },
2512 { "-", URL_IS_DASH },
2513 { NULL, URL_IS_UNKNOWN }