1 --- rpm-4.4.7.org/configure.ac 2006-10-17 22:12:03.110624000 +0200
2 +++ rpm-4.4.7/configure.ac 2006-10-17 22:12:43.117124500 +0200
4 AC_SUBST(WITH_BEECRYPT_INCLUDE)
5 AC_SUBST(WITH_BEECRYPT_LIB)
8 -# Check for neon library. Prefer external, otherwise internal.
12 -AC_CHECK_HEADER([neon/ne_session.h], [
13 - AC_CHECK_LIB(neon, ne_session_create, [
14 - AC_DEFINE(HAVE_LIBNEON, 1, [Define to 1 if you have the 'neon' library (-lneon).])
15 - AC_CHECK_LIB(neon, ne_get_response_header, [
16 - AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, [Define to 1 if you have ne_get_response_header() in libneon.])
18 - AC_CHECK_LIB(neon, ne_send_request_chunk, [
19 - AC_DEFINE(HAVE_NEON_NE_SEND_REQUEST_CHUNK, 1, [Define to 1 if you have ne_send_request_chunk() in libneon.])
21 - WITH_NEON_INCLUDE="-I${includedir}/neon"
22 - WITH_NEON_LIB="-lneon"
25 - if test -d neon ; then
26 - AC_DEFINE(HAVE_LIBNEON, 1, [Define to 1 if you have the 'neon' library (-lneon).])
27 -# XXX HAVE_NEON_NE_GET_RESPONSE_HEADER assumes libneon-0.25 devel internal
28 - AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, [Define to 1 if you have ne_get_response_header() in libneon.])
29 - WITH_NEON_SUBDIR=neon
30 - WITH_NEON_INCLUDE="-I\${top_srcdir}/${WITH_NEON_SUBDIR}/src"
31 - WITH_NEON_LIB="\${top_builddir}/${WITH_NEON_SUBDIR}/src/libneon.la"
34 AC_SUBST(WITH_NEON_SUBDIR)
35 AC_SUBST(WITH_NEON_INCLUDE)
36 AC_SUBST(WITH_NEON_LIB)
37 --- rpm-4.4.8/rpmio/rpmdav.c.orig 2007-02-20 00:51:07.000000000 +0100
38 +++ rpm-4.4.8/rpmio/rpmdav.c 2007-04-08 20:07:07.814412143 +0200
43 -#include "ne_alloc.h"
45 -#include "ne_basic.h"
46 -#include "ne_dates.h"
47 -#include "ne_locks.h"
49 -#define NEONBLOWSCHUNKS
50 -#ifndef NEONBLOWSCHUNKS
51 -/* HACK: include ne_private.h to access sess->socket for now. */
52 -#include "../neon/src/ne_private.h"
55 -#include "ne_props.h"
56 -#include "ne_request.h"
57 -#include "ne_socket.h"
58 -#include "ne_string.h"
59 -#include "ne_utils.h"
61 -/* XXX API changes for neon-0.26.0 */
62 -#if !defined(NE_FREE)
63 -#define ne_set_persist(_sess, _flag)
64 -#define ne_propfind_set_private(_pfh, _create_item, NULL) \
65 - ne_propfind_set_private(_pfh, _create_item, NULL, NULL)
68 #include <rpmio_internal.h>
70 #define _RPMDAV_INTERNAL
74 /* =============================================================== */
75 -int davFree(urlinfo u)
76 - /*@globals internalState @*/
77 - /*@modifies u, internalState @*/
80 - if (u->sess != NULL) {
81 - ne_session_destroy(u->sess);
84 - switch (u->urltype) {
86 - /*@notreached@*/ break;
90 - u->capabilities = _free(u->capabilities);
91 - if (u->lockstore != NULL)
92 - ne_lockstore_destroy(u->lockstore);
93 - u->lockstore = NULL;
101 -static void davProgress(void * userdata, off_t current, off_t total)
104 - urlinfo u = userdata;
109 -assert(sess != NULL);
110 -assert(u == ne_get_session_private(sess, "urlinfo"));
112 - u->current = current;
116 -fprintf(stderr, "*** davProgress(%p,0x%x:0x%x) sess %p u %p\n", userdata, (unsigned int)current, (unsigned int)total, sess, u);
119 -static void davNotify(void * userdata,
120 - ne_conn_status connstatus, const char * info)
123 - urlinfo u = userdata;
126 - static const char * connstates[] = {
136 -assert(sess != NULL);
137 -assert(u == ne_get_session_private(sess, "urlinfo"));
141 - ne_conn_namelookup, /* lookup up hostname (info = hostname) */
142 - ne_conn_connecting, /* connecting to host (info = hostname) */
143 - ne_conn_connected, /* connected to host (info = hostname) */
144 - ne_conn_secure /* connection now secure (info = crypto level) */
148 - u->connstatus = connstatus;
152 -fprintf(stderr, "*** davNotify(%p,%d,%p) sess %p u %p %s\n", userdata, connstatus, info, sess, u, connstates[ (connstatus < 4 ? connstatus : 4)]);
157 -static void davCreateRequest(ne_request * req, void * userdata,
158 - const char * method, const char * uri)
161 - urlinfo u = userdata;
163 - void * private = NULL;
164 - const char * id = "urlinfo";
167 -assert(u->sess != NULL);
168 -assert(req != NULL);
169 - sess = ne_get_session(req);
170 -assert(sess == u->sess);
171 -assert(u == ne_get_session_private(sess, "urlinfo"));
173 -assert(sess != NULL);
174 - private = ne_get_session_private(sess, id);
175 -assert(u == private);
178 -fprintf(stderr, "*** davCreateRequest(%p,%p,%s,%s) %s:%p\n", req, userdata, method, uri, id, private);
181 -static void davPreSend(ne_request * req, void * userdata, ne_buffer * buf)
183 - urlinfo u = userdata;
185 - const char * id = "fd";
189 -assert(u->sess != NULL);
190 -assert(req != NULL);
191 - sess = ne_get_session(req);
192 -assert(sess == u->sess);
193 -assert(u == ne_get_session_private(sess, "urlinfo"));
195 - fd = ne_get_request_private(req, id);
198 -fprintf(stderr, "*** davPreSend(%p,%p,%p) sess %p %s %p\n", req, userdata, buf, sess, id, fd);
200 -fprintf(stderr, "-> %s\n", buf->data);
204 -static int davPostSend(ne_request * req, void * userdata, const ne_status * status)
207 - urlinfo u = userdata;
209 - const char * id = "fd";
213 -assert(u->sess != NULL);
214 -assert(req != NULL);
215 - sess = ne_get_session(req);
216 -assert(sess == u->sess);
217 -assert(u == ne_get_session_private(sess, "urlinfo"));
219 - fd = ne_get_request_private(req, id);
223 -fprintf(stderr, "*** davPostSend(%p,%p,%p) sess %p %s %p %s\n", req, userdata, status, sess, id, fd, ne_get_error(sess));
228 -static void davDestroyRequest(ne_request * req, void * userdata)
231 - urlinfo u = userdata;
233 - const char * id = "fd";
237 -assert(u->sess != NULL);
238 -assert(req != NULL);
239 - sess = ne_get_session(req);
240 -assert(sess == u->sess);
241 -assert(u == ne_get_session_private(sess, "urlinfo"));
243 - fd = ne_get_request_private(req, id);
246 -fprintf(stderr, "*** davDestroyRequest(%p,%p) sess %p %s %p\n", req, userdata, sess, id, fd);
249 -static void davDestroySession(void * userdata)
252 - urlinfo u = userdata;
254 - void * private = NULL;
255 - const char * id = "urlinfo";
258 -assert(u->sess != NULL);
260 -assert(u == ne_get_session_private(sess, "urlinfo"));
262 -assert(sess != NULL);
263 - private = ne_get_session_private(sess, id);
264 -assert(u == private);
267 -fprintf(stderr, "*** davDestroySession(%p) sess %p %s %p\n", userdata, sess, id, private);
271 -davVerifyCert(void *userdata, int failures, const ne_ssl_certificate *cert)
274 - const char *hostname = userdata;
277 -fprintf(stderr, "*** davVerifyCert(%p,%d,%p) %s\n", userdata, failures, cert, hostname);
279 - return 0; /* HACK: trust all server certificates. */
282 -static int davConnect(urlinfo u)
283 - /*@globals internalState @*/
284 - /*@modifies u, internalState @*/
286 - const char * path = NULL;
289 - /* HACK: hkp:// has no steenkin' options */
290 - if (!(u->urltype == URL_IS_HTTP || u->urltype == URL_IS_HTTPS))
293 - /* HACK: where should server capabilities be read? */
294 - (void) urlPath(u->url, &path);
295 - /* HACK: perhaps capture Allow: tag, look for PUT permitted. */
296 - /* XXX [hdr] Allow: GET,HEAD,POST,OPTIONS,TRACE */
297 - rc = ne_options(u->sess, path, u->capabilities);
300 - { ne_server_capabilities *cap = u->capabilities;
301 - if (cap->dav_class1)
302 - u->allow |= RPMURL_SERVER_HASDAVCLASS1;
304 - u->allow &= ~RPMURL_SERVER_HASDAVCLASS1;
305 - if (cap->dav_class2)
306 - u->allow |= RPMURL_SERVER_HASDAVCLASS2;
308 - u->allow &= ~RPMURL_SERVER_HASDAVCLASS2;
309 - if (cap->dav_executable)
310 - u->allow |= RPMURL_SERVER_HASDAVEXEC;
312 - u->allow &= ~RPMURL_SERVER_HASDAVEXEC;
315 - /* HACK: "301 Moved Permanently" on empty subdir. */
316 - if (!strncmp("301 ", ne_get_error(u->sess), sizeof("301 ")-1))
318 - errno = EIO; /* HACK: more precise errno. */
321 - errno = ENOENT; /* HACK: errno same as non-existent path. */
323 - case NE_CONNECT: /* HACK: errno set already? */
327 -fprintf(stderr, "*** Connect to %s:%d failed(%d):\n\t%s\n",
328 - u->host, u->port, rc, ne_get_error(u->sess));
332 - /* HACK: sensitive to error returns? */
333 - u->httpVersion = (ne_version_pre_http11(u->sess) ? 0 : 1);
338 -static int davInit(const char * url, urlinfo * uret)
339 - /*@globals internalState @*/
340 - /*@modifies *uret, internalState @*/
345 -/*@-globs@*/ /* FIX: h_errno annoyance. */
346 - if (urlSplit(url, &u))
347 - return -1; /* XXX error returns needed. */
350 - if (u->url != NULL && u->sess == NULL)
351 - switch (u->urltype) {
353 - assert(u->urltype != u->urltype);
354 - /*@notreached@*/ break;
358 - { ne_server_capabilities * capabilities;
360 - /* HACK: oneshots should be done Somewhere Else Instead. */
362 - rc = ((_dav_debug < 0) ? NE_DBG_HTTP : 0);
363 - ne_debug_init(stderr, rc); /* XXX oneshot? */
365 - rc = ne_sock_init(); /* XXX oneshot? */
367 - u->lockstore = ne_lockstore_create(); /* XXX oneshot? */
369 - u->capabilities = capabilities = xcalloc(1, sizeof(*capabilities));
370 - u->sess = ne_session_create(u->scheme, u->host, u->port);
372 - ne_lockstore_register(u->lockstore, u->sess);
374 - if (u->proxyh != NULL)
375 - ne_session_proxy(u->sess, u->proxyh, u->proxyp);
378 - { const ne_inet_addr ** addrs;
380 - ne_set_addrlist(u->sess, addrs, n);
384 - ne_set_progress(u->sess, davProgress, u);
385 - ne_set_status(u->sess, davNotify, u);
387 - ne_set_persist(u->sess, 1);
388 - ne_set_read_timeout(u->sess, httpTimeoutSecs);
389 - ne_set_useragent(u->sess, PACKAGE "/" PACKAGE_VERSION);
391 - /* XXX check that neon is ssl enabled. */
392 - if (!strcasecmp(u->scheme, "https"))
393 - ne_ssl_set_verify(u->sess, davVerifyCert, (char *)u->host);
395 - ne_set_session_private(u->sess, "urlinfo", u);
397 - ne_hook_destroy_session(u->sess, davDestroySession, u);
399 - ne_hook_create_request(u->sess, davCreateRequest, u);
400 - ne_hook_pre_send(u->sess, davPreSend, u);
401 - ne_hook_post_send(u->sess, davPostSend, u);
402 - ne_hook_destroy_request(u->sess, davDestroyRequest, u);
404 - /* HACK: where should server capabilities be read? */
405 - rc = davConnect(u);
414 - *uret = urlLink(u, __FUNCTION__);
416 - u = urlFree(u, "urlSplit (davInit)");
421 -/* =============================================================== */
422 -enum fetch_rtype_e {
429 -struct fetch_resource_s {
431 - struct fetch_resource_s *next;
435 - enum fetch_rtype_e type;
439 - int is_vcr; /* Is version resource. 0: no vcr, 1 checkin 2 checkout */
440 - char *error_reason; /* error string returned for this resource */
441 - int error_status; /* error status returned for this resource */
445 -static void *fetch_destroy_item(/*@only@*/ struct fetch_resource_s *res)
446 - /*@modifies res @*/
449 - ne_free(res->error_reason);
456 -static void *fetch_destroy_list(/*@only@*/ struct fetch_resource_s *res)
457 - /*@modifies res @*/
459 - struct fetch_resource_s *next;
461 - for (; res != NULL; res = next) {
463 - res = fetch_destroy_item(res);
470 -static void *fetch_create_item(/*@unused@*/ void *userdata, /*@unused@*/ const char *uri)
473 - struct fetch_resource_s * res = ne_calloc(sizeof(*res));
477 -/* =============================================================== */
478 -struct fetch_context_s {
479 -/*@relnull@*/ /*@dependent@*/
480 - struct fetch_resource_s **resrock;
482 - unsigned int include_target; /* Include resource at href */
488 -/*@null@*/ /*@shared@*/
496 -static void *fetch_destroy_context(/*@only@*/ /*@null@*/ struct fetch_context_s *ctx)
497 - /*@globals internalState @*/
498 - /*@modifies ctx, internalState @*/
502 - if (ctx->av != NULL)
503 - ctx->av = argvFree(ctx->av);
504 - ctx->modes = _free(ctx->modes);
505 - ctx->sizes = _free(ctx->sizes);
506 - ctx->mtimes = _free(ctx->mtimes);
507 - ctx->u = urlFree(ctx->u, __FUNCTION__);
508 - ctx->uri = _free(ctx->uri);
510 - memset(ctx, 0, sizeof(*ctx));
517 -static void *fetch_create_context(const char *uri, /*@null@*/ struct stat *st)
518 - /*@globals internalState @*/
519 - /*@modifies internalState @*/
521 - struct fetch_context_s * ctx;
524 -/*@-globs@*/ /* FIX: h_errno annoyance. */
525 - if (urlSplit(uri, &u))
529 - ctx = ne_calloc(sizeof(*ctx));
530 - ctx->uri = xstrdup(uri);
531 - ctx->u = urlLink(u, __FUNCTION__);
532 - if ((ctx->st = st) != NULL)
533 - memset(ctx->st, 0, sizeof(*ctx->st));
537 -/*@unchecked@*/ /*@observer@*/
538 -static const ne_propname fetch_props[] = {
539 - { "DAV:", "getcontentlength" },
540 - { "DAV:", "getlastmodified" },
541 - { "http://apache.org/dav/props/", "executable" },
542 - { "DAV:", "resourcetype" },
543 - { "DAV:", "checked-in" },
544 - { "DAV:", "checked-out" },
548 -#define ELM_resourcetype (NE_PROPS_STATE_TOP + 1)
549 -#define ELM_collection (NE_PROPS_STATE_TOP + 2)
551 -/*@unchecked@*/ /*@observer@*/
552 -static const struct ne_xml_idmap fetch_idmap[] = {
553 - { "DAV:", "resourcetype", ELM_resourcetype },
554 - { "DAV:", "collection", ELM_collection }
557 -static int fetch_startelm(void *userdata, int parent,
558 - const char *nspace, const char *name,
559 - /*@unused@*/ const char **atts)
562 - ne_propfind_handler *pfh = userdata;
563 - struct fetch_resource_s *r = ne_propfind_current_private(pfh);
564 - int state = ne_xml_mapid(fetch_idmap, NE_XML_MAPLEN(fetch_idmap),
568 - !((parent == NE_207_STATE_PROP && state == ELM_resourcetype) ||
569 - (parent == ELM_resourcetype && state == ELM_collection)))
570 - return NE_XML_DECLINE;
572 - if (state == ELM_collection) {
573 - r->type = resr_collection;
579 -static int fetch_compare(const struct fetch_resource_s *r1,
580 - const struct fetch_resource_s *r2)
583 - /* Sort errors first, then collections, then alphabetically */
584 - if (r1->type == resr_error) {
586 - } else if (r2->type == resr_error) {
588 - } else if (r1->type == resr_collection) {
589 - if (r2->type != resr_collection) {
592 - return strcmp(r1->uri, r2->uri);
595 - if (r2->type != resr_collection) {
596 - return strcmp(r1->uri, r2->uri);
603 -static void fetch_results(void *userdata, void *uarg,
604 - const ne_prop_result_set *set)
607 - struct fetch_context_s *ctx = userdata;
608 - struct fetch_resource_s *current, *previous, *newres;
609 - const char *clength, *modtime, *isexec;
610 - const char *checkin, *checkout;
611 - const ne_status *status = NULL;
612 - const char * path = NULL;
614 -#if !defined(NE_FREE)
615 - const ne_uri * uri = uarg;
616 - (void) urlPath(uri->path, &path);
618 - const char * uri = uarg;
619 - (void) urlPath(uri, &path);
624 - newres = ne_propset_private(set);
627 -fprintf(stderr, "==> %s in uri %s\n", path, ctx->uri);
629 - if (ne_path_compare(ctx->uri, path) == 0 && !ctx->include_target) {
630 - /* This is the target URI */
632 -fprintf(stderr, "==> %s skipping target resource.\n", path);
633 - /* Free the private structure. */
634 -/*@-dependenttrans -exposetrans@*/
636 -/*@=dependenttrans =exposetrans@*/
640 - newres->uri = ne_strdup(path);
643 - clength = ne_propset_value(set, &fetch_props[0]);
644 - modtime = ne_propset_value(set, &fetch_props[1]);
645 - isexec = ne_propset_value(set, &fetch_props[2]);
646 - checkin = ne_propset_value(set, &fetch_props[4]);
647 - checkout = ne_propset_value(set, &fetch_props[5]);
651 - if (clength == NULL)
652 - status = ne_propset_status(set, &fetch_props[0]);
653 - if (modtime == NULL)
654 - status = ne_propset_status(set, &fetch_props[1]);
657 - if (newres->type == resr_normal && status != NULL) {
658 - /* It's an error! */
659 - newres->error_status = status->code;
661 - /* Special hack for Apache 1.3/mod_dav */
662 - if (strcmp(status->reason_phrase, "status text goes here") == 0) {
664 - if (status->code == 401) {
665 - desc = _("Authorization Required");
666 - } else if (status->klass == 3) {
667 - desc = _("Redirect");
668 - } else if (status->klass == 5) {
669 - desc = _("Server Error");
671 - desc = _("Unknown Error");
673 - newres->error_reason = ne_strdup(desc);
675 - newres->error_reason = ne_strdup(status->reason_phrase);
677 - newres->type = resr_error;
680 - if (isexec && strcasecmp(isexec, "T") == 0) {
681 - newres->is_executable = 1;
683 - newres->is_executable = 0;
687 - newres->modtime = ne_httpdate_parse(modtime);
690 - newres->size = atoi(clength);
694 - newres->is_vcr = 1;
695 - } else if (checkout) {
696 - newres->is_vcr = 2;
698 - newres->is_vcr = 0;
701 - for (current = *ctx->resrock, previous = NULL; current != NULL;
702 - previous = current, current = current->next)
704 - if (fetch_compare(current, newres) >= 0) {
709 - previous->next = newres;
711 -/*@-boundswrite -dependenttrans @*/
712 - *ctx->resrock = newres;
713 -/*@=boundswrite =dependenttrans @*/
715 - newres->next = current;
718 -static int davFetch(const urlinfo u, struct fetch_context_s * ctx)
719 - /*@globals internalState @*/
720 - /*@modifies ctx, internalState @*/
722 - const char * path = NULL;
723 - int depth = 1; /* XXX passed arg? */
724 - unsigned int include_target = 0; /* XXX passed arg? */
725 - struct fetch_resource_s * resitem = NULL;
726 - struct fetch_resource_s ** resrock = &resitem; /* XXX passed arg? */
727 - ne_propfind_handler *pfh;
728 - struct fetch_resource_s *current, *next;
733 - (void) urlPath(u->url, &path);
734 - pfh = ne_propfind_create(u->sess, ctx->uri, depth);
736 - /* HACK: need to set RPMURL_SERVER_HASRANGE in u->allow here. */
738 - ctx->resrock = resrock;
739 - ctx->include_target = include_target;
741 - ne_xml_push_handler(ne_propfind_get_parser(pfh),
742 - fetch_startelm, NULL, NULL, pfh);
744 - ne_propfind_set_private(pfh, fetch_create_item, NULL);
746 - rc = ne_propfind_named(pfh, fetch_props, fetch_results, ctx);
748 - ne_propfind_destroy(pfh);
750 - for (current = resitem; current != NULL; current = next) {
751 - const char *s, *se;
754 - next = current->next;
756 - /* Collections have trailing '/' that needs trim. */
757 - /* The top level collection is returned as well. */
758 - se = current->uri + strlen(current->uri);
759 - if (se[-1] == '/') {
760 - if (strlen(current->uri) <= strlen(path)) {
761 - current = fetch_destroy_item(current);
767 - while (s > current->uri && s[-1] != '/')
770 - val = ne_strndup(s, (se - s));
773 - val = ne_path_unescape(val);
776 - xx = argvAdd(&ctx->av, val);
778 -fprintf(stderr, "*** argvAdd(%p,\"%s\")\n", &ctx->av, val);
781 - while (ctx->ac >= ctx->nalloced) {
782 - if (ctx->nalloced <= 0)
784 - ctx->nalloced *= 2;
785 - ctx->modes = xrealloc(ctx->modes,
786 - (sizeof(*ctx->modes) * ctx->nalloced));
787 - ctx->sizes = xrealloc(ctx->sizes,
788 - (sizeof(*ctx->sizes) * ctx->nalloced));
789 - ctx->mtimes = xrealloc(ctx->mtimes,
790 - (sizeof(*ctx->mtimes) * ctx->nalloced));
793 - switch (current->type) {
796 - /*@switchbreak@*/ break;
797 - case resr_collection:
799 - /*@switchbreak@*/ break;
800 - case resr_reference:
804 - /*@switchbreak@*/ break;
807 - ctx->modes[ctx->ac] = st_mode;
808 - ctx->sizes[ctx->ac] = current->size;
809 - ctx->mtimes[ctx->ac] = current->modtime;
813 - current = fetch_destroy_item(current);
815 - ctx->resrock = NULL; /* HACK: avoid leaving stack reference. */
816 - /* HACK realloc to truncate modes/sizes/mtimes */
821 -/* HACK this should be rewritten to use davReq/davResp w callbacks. */
822 -static int davHEAD(urlinfo u, struct stat *st)
823 - /*@modifies *st @*/
827 - const char *value = NULL;
830 - st->st_mode = S_IFREG;
831 - st->st_blksize = 4 * 1024; /* HACK correct for linux ext */
837 - req = ne_request_create(u->sess, "HEAD", u->url);
839 - rc = ne_request_dispatch(req);
845 - if (ne_get_status(req)->klass != 2) {
854 - value = ne_get_response_header(req, htag);
856 - /* inode-size-mtime */
860 - htag = "Content-Length";
861 -#if defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
862 - value = ne_get_response_header(req, htag);
865 - st->st_size = strtoll(value, NULL, 10);
866 - st->st_blocks = (st->st_size + 511)/512;
869 - htag = "Last-Modified";
870 -#if defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
871 - value = ne_get_response_header(req, htag);
874 - st->st_mtime = ne_httpdate_parse(value);
875 - st->st_atime = st->st_ctime = st->st_mtime; /* HACK */
879 - ne_request_destroy(req);
883 -static int davNLST(struct fetch_context_s * ctx)
884 - /*@globals internalState @*/
885 - /*@modifies ctx, internalState @*/
891 - rc = davInit(ctx->uri, &u);
892 - if (rc || u == NULL)
895 -/* HACK do PROPFIND through davFetch iff enabled, otherwise HEAD Content-length/ETag/Last-Modified */
896 - if (u->allow & RPMURL_SERVER_HASDAV)
897 - rc = davFetch(u, ctx); /* use PROPFIND to get contentLength */
899 - rc = davHEAD(u, ctx->st); /* use HEAD to get contentLength */
905 - /* HACK: "405 Method Not Allowed" for PROPFIND on non-DAV servers. */
906 - /* XXX #206066 OPTIONS is ok, but PROPFIND from Stat() fails. */
907 - /* rpm -qp --rpmiodebug --davdebug http://people.freedesktop.org/~sandmann/metacity-2.16.0-2.fc6/i386/metacity-2.16.0-2.fc6.i386.rpm */
908 - /* HACK: "301 Moved Permanently" on empty subdir. */
909 - if (!strncmp("301 ", ne_get_error(u->sess), sizeof("301 ")-1))
914 -fprintf(stderr, "*** Fetch from %s:%d failed:\n\t%s\n",
915 - u->host, u->port, ne_get_error(u->sess));
924 -/* =============================================================== */
925 -static int my_result(const char * msg, int ret, /*@null@*/ FILE * fp)
926 - /*@modifies *fp @*/
928 - /* HACK: don't print unless debugging. */
929 - if (_dav_debug >= 0)
934 - fprintf(fp, "*** %s: ", msg);
936 - /* HACK FTPERR_NE_FOO == -NE_FOO error impedance match */
938 - fprintf(fp, "%s: %s\n", ftpStrerror(-ret), ne_get_error(sess));
940 - fprintf(fp, "%s\n", ftpStrerror(-ret));
946 -static void hexdump(const unsigned char * buf, ssize_t len)
952 - for (i = 0; i < len; i++) {
953 - if (i != 0 && (i%16) == 0)
954 - fprintf(stderr, "\n");
955 - fprintf(stderr, " %02X", buf[i]);
957 - fprintf(stderr, "\n");
962 -static void davAcceptRanges(void * userdata, /*@null@*/ const char * value)
963 - /*@modifies userdata @*/
965 - urlinfo u = userdata;
967 - if (!(u != NULL && value != NULL)) return;
969 -fprintf(stderr, "*** u %p Accept-Ranges: %s\n", u, value);
970 - if (!strcmp(value, "bytes"))
971 - u->allow |= RPMURL_SERVER_HASRANGE;
972 - if (!strcmp(value, "none"))
973 - u->allow &= ~RPMURL_SERVER_HASRANGE;
977 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
978 -static void davAllHeaders(void * userdata, const char * value)
980 - FD_t ctrl = userdata;
982 - if (!(ctrl != NULL && value != NULL)) return;
984 -fprintf(stderr, "<- %s\n", value);
989 -static void davContentLength(void * userdata, /*@null@*/ const char * value)
990 - /*@modifies userdata @*/
992 - FD_t ctrl = userdata;
994 - if (!(ctrl != NULL && value != NULL)) return;
996 -fprintf(stderr, "*** fd %p Content-Length: %s\n", ctrl, value);
998 - ctrl->contentLength = strtoll(value, NULL, 10);
1004 -static void davConnection(void * userdata, /*@null@*/ const char * value)
1005 - /*@modifies userdata @*/
1007 - FD_t ctrl = userdata;
1009 - if (!(ctrl != NULL && value != NULL)) return;
1010 -if (_dav_debug < 0)
1011 -fprintf(stderr, "*** fd %p Connection: %s\n", ctrl, value);
1012 - if (!strcasecmp(value, "close"))
1013 - ctrl->persist = 0;
1014 - else if (!strcasecmp(value, "Keep-Alive"))
1015 - ctrl->persist = 1;
1019 -/*@-mustmod@*/ /* HACK: stash error in *str. */
1020 -int davResp(urlinfo u, FD_t ctrl, /*@unused@*/ char *const * str)
1024 - rc = ne_begin_request(ctrl->req);
1025 - rc = my_result("ne_begin_req(ctrl->req)", rc, NULL);
1027 -if (_dav_debug < 0)
1028 -fprintf(stderr, "*** davResp(%p,%p,%p) sess %p req %p rc %d\n", u, ctrl, str, u->sess, ctrl->req, rc);
1030 - /* HACK FTPERR_NE_FOO == -NE_FOO error impedance match */
1031 -/*@-observertrans@*/
1033 - fdSetSyserrno(ctrl, errno, ftpStrerror(-rc));
1034 -/*@=observertrans@*/
1040 -int davReq(FD_t ctrl, const char * httpCmd, const char * httpArg)
1045 -assert(ctrl != NULL);
1049 -if (_dav_debug < 0)
1050 -fprintf(stderr, "*** davReq(%p,%s,\"%s\") entry sess %p req %p\n", ctrl, httpCmd, (httpArg ? httpArg : ""), u->sess, ctrl->req);
1052 - ctrl->persist = (u->httpVersion > 0 ? 1 : 0);
1053 - ctrl = fdLink(ctrl, "open ctrl (davReq)");
1055 -assert(u->sess != NULL);
1056 -assert(ctrl->req == NULL);
1058 - ctrl->req = ne_request_create(u->sess, httpCmd, httpArg);
1060 -assert(ctrl->req != NULL);
1062 - ne_set_request_private(ctrl->req, "fd", ctrl);
1064 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
1065 - ne_add_response_header_catcher(ctrl->req, davAllHeaders, ctrl);
1067 - ne_add_response_header_handler(ctrl->req, "Content-Length",
1068 - davContentLength, ctrl);
1069 - ne_add_response_header_handler(ctrl->req, "Connection",
1070 - davConnection, ctrl);
1073 - if (!strcmp(httpCmd, "PUT")) {
1074 -#if defined(HAVE_NEON_NE_SEND_REQUEST_CHUNK)
1075 - ctrl->wr_chunked = 1;
1076 - ne_add_request_header(ctrl->req, "Transfer-Encoding", "chunked");
1077 - ne_set_request_chunked(ctrl->req, 1);
1078 - /* HACK: no retries if/when chunking. */
1079 - rc = davResp(u, ctrl, NULL);
1081 - rc = FTPERR_SERVER_IO_ERROR;
1084 - /* HACK: possible Last-Modified: Tue, 02 Nov 2004 14:29:36 GMT */
1085 - /* HACK: possible ETag: "inode-size-mtime" */
1086 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
1087 - ne_add_response_header_handler(ctrl->req, "Accept-Ranges",
1088 - davAcceptRanges, u);
1090 - /* HACK: possible Transfer-Encoding: on GET. */
1092 - /* HACK: other errors may need retry too. */
1093 - /* HACK: neon retries once, gud enuf. */
1094 - /* HACK: retry counter? */
1096 - rc = davResp(u, ctrl, NULL);
1097 - } while (rc == NE_RETRY);
1102 -if (_dav_debug < 0)
1103 -fprintf(stderr, "*** davReq(%p,%s,\"%s\") exit sess %p req %p rc %d\n", ctrl, httpCmd, (httpArg ? httpArg : ""), u->sess, ctrl->req, rc);
1105 -#if defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
1106 - davContentLength(ctrl,
1107 - ne_get_response_header(ctrl->req, "Content-Length"));
1108 - davConnection(ctrl,
1109 - ne_get_response_header(ctrl->req, "Connection"));
1110 - if (strcmp(httpCmd, "PUT"))
1111 - davAcceptRanges(u,
1112 - ne_get_response_header(ctrl->req, "Accept-Ranges"));
1115 - ctrl = fdLink(ctrl, "open data (davReq)");
1119 -/*@-observertrans@*/
1120 - fdSetSyserrno(ctrl, errno, ftpStrerror(rc));
1121 -/*@=observertrans@*/
1123 - /* HACK balance fd refs. ne_session_destroy to tear down non-keepalive? */
1124 - ctrl = fdLink(ctrl, "error data (davReq)");
1129 -FD_t davOpen(const char * url, /*@unused@*/ int flags,
1130 - /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
1132 - const char * path = NULL;
1133 - urltype urlType = urlPath(url, &path);
1138 -#if 0 /* XXX makeTempFile() heartburn */
1139 - assert(!(flags & O_RDWR));
1142 -if (_dav_debug < 0)
1143 -fprintf(stderr, "*** davOpen(%s,0x%x,0%o,%p)\n", url, flags, mode, uret);
1144 - rc = davInit(url, &u);
1145 - if (rc || u == NULL || u->sess == NULL)
1148 - if (u->ctrl == NULL)
1149 - u->ctrl = fdNew("persist ctrl (davOpen)");
1150 - if (u->ctrl->nrefs > 2 && u->data == NULL)
1151 - u->data = fdNew("persist data (davOpen)");
1153 - if (u->ctrl->url == NULL)
1154 - fd = fdLink(u->ctrl, "grab ctrl (davOpen persist ctrl)");
1155 - else if (u->data->url == NULL)
1156 - fd = fdLink(u->data, "grab ctrl (davOpen persist data)");
1158 - fd = fdNew("grab ctrl (davOpen)");
1161 - fdSetOpen(fd, url, flags, mode);
1162 - fdSetIo(fd, ufdio);
1164 - fd->ftpFileDoneNeeded = 0;
1165 - fd->rd_timeoutsecs = httpTimeoutSecs;
1166 - fd->contentLength = fd->bytesRemain = -1;
1167 - fd->url = urlLink(u, "url (davOpen)");
1168 - fd = fdLink(fd, "grab data (davOpen)");
1169 -assert(urlType == URL_IS_HTTPS || urlType == URL_IS_HTTP || urlType == URL_IS_HKP);
1170 - fd->urlType = urlType;
1178 - /*@-refcounttrans@*/
1180 - /*@=refcounttrans@*/
1183 -ssize_t davRead(void * cookie, /*@out@*/ char * buf, size_t count)
1189 -assert(count >= 128); /* HACK: see ne_request.h comment */
1191 - rc = ne_read_response_block(fd->req, buf, count);
1193 -if (_dav_debug < 0) {
1194 -fprintf(stderr, "*** davRead(%p,%p,0x%x) rc 0x%x\n", cookie, buf, (unsigned)count, (unsigned)rc);
1203 -ssize_t davWrite(void * cookie, const char * buf, size_t count)
1209 -#if !defined(NEONBLOWSCHUNKS)
1210 - ne_session * sess;
1212 -assert(fd->req != NULL);
1213 - sess = ne_get_session(fd->req);
1214 -assert(sess != NULL);
1216 - /* HACK: include ne_private.h to access sess->socket for now. */
1217 - xx = ne_sock_fullwrite(sess->socket, buf, count);
1219 -#if defined(HAVE_NEON_NE_SEND_REQUEST_CHUNK) || defined(__LCLINT__)
1220 -assert(fd->req != NULL);
1221 - xx = ne_send_request_chunk(fd->req, buf, count);
1223 - errno = EIO; /* HACK */
1228 - /* HACK: stupid error impedence matching. */
1229 - rc = (xx == 0 ? count : -1);
1231 -if (_dav_debug < 0)
1232 -fprintf(stderr, "*** davWrite(%p,%p,0x%x) rc 0x%x\n", cookie, buf, (unsigned)count, (unsigned)rc);
1235 -hexdump(buf, count);
1241 -int davSeek(void * cookie, /*@unused@*/ _libio_pos_t pos, int whence)
1243 -if (_dav_debug < 0)
1244 -fprintf(stderr, "*** davSeek(%p,pos,%d)\n", cookie, whence);
1248 -/*@-mustmod@*/ /* HACK: fd->req is modified. */
1249 -int davClose(void * cookie)
1256 -assert(fd->req != NULL);
1257 - rc = ne_end_request(fd->req);
1258 - rc = my_result("ne_end_request(req)", rc, NULL);
1260 - ne_request_destroy(fd->req);
1263 -if (_dav_debug < 0)
1264 -fprintf(stderr, "*** davClose(%p) rc %d\n", fd, rc);
1269 -/* =============================================================== */
1270 -int davMkdir(const char * path, mode_t mode)
1273 - const char * src = NULL;
1276 - rc = davInit(path, &u);
1280 - (void) urlPath(path, &src);
1282 - rc = ne_mkcol(u->sess, path);
1284 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1286 - /* XXX HACK: verify getrestype(remote) == resr_collection */
1290 -fprintf(stderr, "*** davMkdir(%s,0%o) rc %d\n", path, mode, rc);
1294 -int davRmdir(const char * path)
1297 - const char * src = NULL;
1300 - rc = davInit(path, &u);
1304 - (void) urlPath(path, &src);
1306 - /* XXX HACK: only getrestype(remote) == resr_collection */
1308 - rc = ne_delete(u->sess, path);
1310 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1314 -fprintf(stderr, "*** davRmdir(%s) rc %d\n", path, rc);
1318 -int davRename(const char * oldpath, const char * newpath)
1321 - const char * src = NULL;
1322 - const char * dst = NULL;
1323 - int overwrite = 1; /* HACK: set this correctly. */
1326 - rc = davInit(oldpath, &u);
1330 - (void) urlPath(oldpath, &src);
1331 - (void) urlPath(newpath, &dst);
1333 - /* XXX HACK: only getrestype(remote) != resr_collection */
1335 - rc = ne_move(u->sess, overwrite, src, dst);
1337 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1341 -fprintf(stderr, "*** davRename(%s,%s) rc %d\n", oldpath, newpath, rc);
1345 -int davUnlink(const char * path)
1348 - const char * src = NULL;
1351 - rc = davInit(path, &u);
1355 - (void) urlPath(path, &src);
1357 - /* XXX HACK: only getrestype(remote) != resr_collection */
1359 - rc = ne_delete(u->sess, src);
1362 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1365 -fprintf(stderr, "*** davUnlink(%s) rc %d\n", path, rc);
1370 -static int davChdir(const char * path)
1371 - /*@globals h_errno, fileSystem, internalState @*/
1372 - /*@modifies fileSystem, internalState @*/
1374 - return davCommand("CWD", path, NULL);
1376 -#endif /* NOTYET */
1378 -/* =============================================================== */
1380 -static const char * statstr(const struct stat * st,
1381 - /*@returned@*/ /*@out@*/ char * buf)
1382 - /*@modifies *buf @*/
1385 - "*** dev %x ino %x mode %0o nlink %d uid %d gid %d rdev %x size %x\n",
1386 - (unsigned)st->st_dev,
1387 - (unsigned)st->st_ino,
1389 - (unsigned)st->st_nlink,
1392 - (unsigned)st->st_rdev,
1393 - (unsigned)st->st_size);
1398 -static int dav_st_ino = 0xdead0000;
1401 -int davStat(const char * path, /*@out@*/ struct stat *st)
1402 - /*@globals dav_st_ino, fileSystem, internalState @*/
1403 - /*@modifies *st, dav_st_ino, fileSystem, internalState @*/
1405 - struct fetch_context_s * ctx = NULL;
1409 -/* HACK: neon really wants collections with trailing '/' */
1410 - ctx = fetch_create_context(path, st);
1411 - if (ctx == NULL) {
1412 -fprintf(stderr, "==> %s fetch_create_context ctx %p\n", __FUNCTION__, ctx);
1413 -/* HACK: errno = ??? */
1416 - rc = davNLST(ctx);
1418 -/* HACK: errno = ??? */
1422 - if (st->st_mode == 0)
1423 - st->st_mode = (ctx->ac > 1 ? S_IFDIR : S_IFREG);
1424 - st->st_size = (ctx->sizes ? ctx->sizes[0] : st->st_size);
1425 - st->st_mtime = (ctx->mtimes ? ctx->mtimes[0] : st->st_mtime);
1426 - st->st_atime = st->st_ctime = st->st_mtime; /* HACK */
1427 - if (S_ISDIR(st->st_mode)) {
1429 - st->st_mode |= 0755;
1431 - if (S_ISREG(st->st_mode)) {
1433 - st->st_mode |= 0644;
1436 - /* XXX fts(3) needs/uses st_ino, make something up for now. */
1437 - if (st->st_ino == 0)
1438 - st->st_ino = dav_st_ino++;
1441 -if (_dav_debug < 0)
1442 -fprintf(stderr, "*** davStat(%s) rc %d\n%s", path, rc, statstr(st, buf));
1443 - ctx = fetch_destroy_context(ctx);
1449 -int davLstat(const char * path, /*@out@*/ struct stat *st)
1450 - /*@globals dav_st_ino, fileSystem, internalState @*/
1451 - /*@modifies *st, dav_st_ino, fileSystem, internalState @*/
1453 - struct fetch_context_s * ctx = NULL;
1457 -/* HACK: neon really wants collections with trailing '/' */
1458 - ctx = fetch_create_context(path, st);
1459 - if (ctx == NULL) {
1460 -/* HACK: errno = ??? */
1463 - rc = davNLST(ctx);
1465 -/* HACK: errno = ??? */
1469 - if (st->st_mode == 0)
1470 - st->st_mode = (ctx->ac > 1 ? S_IFDIR : S_IFREG);
1471 - st->st_size = (ctx->sizes ? ctx->sizes[0] : st->st_size);
1472 - st->st_mtime = (ctx->mtimes ? ctx->mtimes[0] : st->st_mtime);
1473 - st->st_atime = st->st_ctime = st->st_mtime; /* HACK */
1474 - if (S_ISDIR(st->st_mode)) {
1476 - st->st_mode |= 0755;
1478 - if (S_ISREG(st->st_mode)) {
1480 - st->st_mode |= 0644;
1483 - /* XXX fts(3) needs/uses st_ino, make something up for now. */
1484 - if (st->st_ino == 0)
1485 - st->st_ino = dav_st_ino++;
1486 -if (_dav_debug < 0)
1487 -fprintf(stderr, "*** davLstat(%s) rc %d\n%s\n", path, rc, statstr(st, buf));
1489 - ctx = fetch_destroy_context(ctx);
1495 -static int davReadlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
1496 - /*@globals h_errno, fileSystem, internalState @*/
1497 - /*@modifies *buf, fileSystem, internalState @*/
1500 - rc = davNLST(path, DO_FTP_READLINK, NULL, buf, bufsiz);
1501 -if (_dav_debug < 0)
1502 -fprintf(stderr, "*** davReadlink(%s) rc %d\n", path, rc);
1505 -#endif /* NOTYET */
1507 -/* =============================================================== */
1509 int avmagicdir = 0x3607113;
1511 @@ -1625,171 +167,3 @@
1515 -/* =============================================================== */
1517 -int davmagicdir = 0x8440291;
1519 -int davClosedir(/*@only@*/ DIR * dir)
1521 - DAVDIR avdir = (DAVDIR)dir;
1523 -if (_dav_debug < 0)
1524 -fprintf(stderr, "*** davClosedir(%p)\n", avdir);
1526 -#if defined(HAVE_PTHREAD_H)
1527 -/*@-moduncon -noeffectuncon @*/
1528 - (void) pthread_mutex_destroy(&avdir->lock);
1529 -/*@=moduncon =noeffectuncon @*/
1532 - avdir = _free(avdir);
1536 -struct dirent * davReaddir(DIR * dir)
1538 - DAVDIR avdir = (DAVDIR)dir;
1539 - struct dirent * dp;
1541 - unsigned char * dt;
1545 - if (avdir == NULL || !ISDAVMAGIC(avdir) || avdir->data == NULL) {
1546 - /* XXX TODO: EBADF errno. */
1550 - dp = (struct dirent *) avdir->data;
1551 - av = (const char **) (dp + 1);
1553 - dt = (char *) (av + (ac + 1));
1554 - i = avdir->offset + 1;
1557 - if (i < 0 || i >= ac || av[i] == NULL)
1561 - avdir->offset = i;
1563 - /* XXX glob(3) uses REAL_DIR_ENTRY(dp) test on d_ino */
1565 - dp->d_ino = i + 1; /* W2DO? */
1566 - dp->d_reclen = 0; /* W2DO? */
1568 -#if !(defined(hpux) || defined(__hpux) || defined(sun))
1569 -#if !defined(__APPLE__) && !defined(__FreeBSD_kernel__)
1570 - dp->d_off = 0; /* W2DO? */
1573 - dp->d_type = dt[i];
1578 - strncpy(dp->d_name, av[i], sizeof(dp->d_name));
1579 -if (_dav_debug < 0)
1580 -fprintf(stderr, "*** davReaddir(%p) %p \"%s\"\n", (void *)avdir, dp, dp->d_name);
1586 -DIR * davOpendir(const char * path)
1588 - struct fetch_context_s * ctx;
1590 - struct dirent * dp;
1592 - const char ** av, ** nav;
1593 - unsigned char * dt;
1598 - /* HACK: glob does not pass dirs with trailing '/' */
1599 - nb = strlen(path)+1;
1601 - if (path[nb-1] != '/') {
1602 - char * npath = alloca(nb+1);
1604 - (void) stpcpy( stpcpy(npath, path), "/");
1609 -if (_dav_debug < 0)
1610 -fprintf(stderr, "*** davOpendir(%s)\n", path);
1612 - /* Load DAV collection into argv. */
1613 - ctx = fetch_create_context(path, NULL);
1614 - if (ctx == NULL) {
1615 -/* HACK: errno = ??? */
1618 - rc = davNLST(ctx);
1620 -/* HACK: errno = ??? */
1628 - while (av[ac] != NULL)
1629 - nb += strlen(av[ac++]) + 1;
1630 - ac += 2; /* for "." and ".." */
1631 - nb += sizeof(".") + sizeof("..");
1633 - nb += sizeof(*avdir) + sizeof(*dp) + ((ac + 1) * sizeof(*av)) + (ac + 1);
1634 - avdir = xcalloc(1, nb);
1636 - dp = (struct dirent *) (avdir + 1);
1637 - nav = (const char **) (dp + 1);
1638 - dt = (char *) (nav + (ac + 1));
1639 - t = (char *) (dt + ac + 1);
1642 - avdir->fd = davmagicdir;
1644 - avdir->data = (char *) dp;
1646 - avdir->allocation = nb;
1648 - avdir->offset = -1;
1649 - avdir->filepos = 0;
1651 -#if defined(HAVE_PTHREAD_H)
1652 -/*@-moduncon -noeffectuncon -nullpass @*/
1653 - (void) pthread_mutex_init(&avdir->lock, NULL);
1654 -/*@=moduncon =noeffectuncon =nullpass @*/
1658 -/*@-dependenttrans -unrecog@*/
1659 - dt[nac] = DT_DIR; nav[nac++] = t; t = stpcpy(t, "."); t++;
1660 - dt[nac] = DT_DIR; nav[nac++] = t; t = stpcpy(t, ".."); t++;
1661 -/*@=dependenttrans =unrecog@*/
1663 - /* Copy DAV items into DIR elments. */
1666 - while (av[ac] != NULL) {
1668 - dt[nac] = (S_ISDIR(ctx->modes[ac]) ? DT_DIR : DT_REG);
1669 - t = stpcpy(t, av[ac]);
1676 - ctx = fetch_destroy_context(ctx);
1679 - return (DIR *) avdir;
1683 diff -ur rpm-4.4.7.org/rpmio/rpmdav.h rpm-4.4.7/rpmio/rpmdav.h
1684 --- rpm-4.4.7.org/rpmio/rpmdav.h 2005-10-11 21:13:59.000000000 +0200
1685 +++ rpm-4.4.7/rpmio/rpmdav.h 2006-10-17 22:35:33.742783250 +0200
1687 extern int avmagicdir;
1688 #define ISAVMAGIC(_dir) (!memcmp((_dir), &avmagicdir, sizeof(avmagicdir)))
1693 -extern int davmagicdir;
1694 -#define ISDAVMAGIC(_dir) (!memcmp((_dir), &davmagicdir, sizeof(davmagicdir)))
1700 /*@globals fileSystem, internalState @*/
1701 /*@modifies fileSystem, internalState @*/;
1704 - * Send a http request.
1706 - * @param httpCmd http command
1707 - * @param httpArg http command argument (NULL if none)
1708 - * @returns 0 on success
1710 -int davReq(FD_t ctrl, const char * httpCmd, /*@null@*/ const char * httpArg)
1711 - /*@globals fileSystem, internalState @*/
1712 - /*@modifies ctrl, fileSystem, internalState @*/;
1715 - * Read a http response.
1718 - * @retval *str error msg
1719 - * @returns 0 on success
1722 -int davResp(urlinfo u, FD_t ctrl, /*@out@*/ /*@null@*/ char *const * str)
1723 - /*@globals fileSystem, internalState @*/
1724 - /*@modifies ctrl, *str, fileSystem, internalState @*/;
1730 -FD_t davOpen(const char * url, /*@unused@*/ int flags,
1731 - /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
1732 - /*@globals internalState @*/
1733 - /*@modifies *uret, internalState @*/;
1738 -ssize_t davRead(void * cookie, /*@out@*/ char * buf, size_t count)
1739 - /*@globals fileSystem, internalState @*/
1740 - /*@modifies buf, fileSystem, internalState @*/
1741 - /*@requires maxSet(buf) >= (count - 1) @*/
1742 - /*@ensures maxRead(buf) == result @*/;
1747 -ssize_t davWrite(void * cookie, const char * buf, size_t count)
1748 - /*@globals fileSystem, internalState @*/
1749 - /*@modifies fileSystem, internalState @*/;
1753 -int davSeek(void * cookie, _libio_pos_t pos, int whence)
1754 - /*@globals fileSystem, internalState @*/
1755 - /*@modifies fileSystem, internalState @*/;
1759 -int davClose(void * cookie)
1760 - /*@globals fileSystem, internalState @*/
1761 - /*@modifies cookie, fileSystem, internalState @*/;
1765 -int davMkdir(const char * path, mode_t mode)
1766 - /*@globals fileSystem, internalState @*/
1767 - /*@modifies fileSystem, internalState @*/;
1771 -int davRmdir(const char * path)
1772 - /*@globals fileSystem, internalState @*/
1773 - /*@modifies fileSystem, internalState @*/;
1777 -int davRename(const char * oldpath, const char * newpath)
1778 - /*@globals fileSystem, internalState @*/
1779 - /*@modifies fileSystem, internalState @*/;
1783 -int davUnlink(const char * path)
1784 - /*@globals fileSystem, internalState @*/
1785 - /*@modifies fileSystem, internalState @*/;
1788 - * Close a DAV collection.
1789 - * @param dir argv DIR
1790 - * @return 0 always
1792 -int davClosedir(/*@only@*/ DIR * dir)
1793 - /*@globals fileSystem @*/
1794 - /*@modifies dir, fileSystem @*/;
1797 - * Return next entry from a DAV collection.
1798 - * @param dir argv DIR
1799 - * @return next entry
1801 -/*@dependent@*/ /*@null@*/
1802 -struct dirent * davReaddir(DIR * dir)
1803 - /*@globals fileSystem @*/
1804 - /*@modifies fileSystem @*/;
1807 - * Create an argv directory from DAV collection.
1808 - * @param path URL for DAV collection path
1809 - * @return argv DIR
1812 -DIR * davOpendir(const char * path)
1813 - /*@globals fileSystem, internalState @*/
1814 - /*@modifies fileSystem, internalState @*/;
1819 -int davStat(const char * path, /*@out@*/ struct stat * st)
1820 - /*@globals fileSystem, internalState @*/
1821 - /*@modifies *st, fileSystem, internalState @*/;
1826 -int davLstat(const char * path, /*@out@*/ struct stat * st)
1827 - /*@globals fileSystem, internalState @*/
1828 - /*@modifies *st, fileSystem, internalState @*/;
1833 diff -ur rpm-4.4.7.org/rpmio/rpmio.c rpm-4.4.7/rpmio/rpmio.c
1834 --- rpm-4.4.7.org/rpmio/rpmio.c 2006-08-08 08:55:01.000000000 +0200
1835 +++ rpm-4.4.7/rpmio/rpmio.c 2006-10-17 22:18:38.135311750 +0200
1836 @@ -406,13 +406,6 @@
1838 fdstat_enter(fd, FDSTAT_READ);
1840 - /* HACK: flimsy wiring for davRead */
1841 - if (fd->req != NULL) {
1842 - rc = davRead(fd, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1843 - /* XXX Chunked davRead EOF. */
1845 - fd->bytesRemain = 0;
1847 rc = read(fdFileno(fd), buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1849 fdstat_exit(fd, FDSTAT_READ, rc);
1850 @@ -440,10 +433,6 @@
1852 fdstat_enter(fd, FDSTAT_WRITE);
1854 - /* HACK: flimsy wiring for davWrite */
1855 - if (fd->req != NULL)
1856 - rc = davWrite(fd, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1858 rc = write(fdno, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1860 fdstat_exit(fd, FDSTAT_WRITE, rc);
1861 @@ -490,11 +479,6 @@
1864 fdstat_enter(fd, FDSTAT_CLOSE);
1865 - /* HACK: flimsy wiring for davClose */
1867 - if (fd->req != NULL)
1868 - rc = davClose(fd);
1870 rc = ((fdno >= 0) ? close(fdno) : -2);
1872 fdstat_exit(fd, FDSTAT_CLOSE, rc);
1873 @@ -547,10 +531,6 @@
1877 - /* HACK: flimsy wiring for davWrite */
1878 - if (fd->req != NULL)
1881 if ((fdno = fdFileno(fd)) < 0)
1882 return -1; /* XXX W2DO? */
1884 @@ -602,10 +582,6 @@
1888 - /* HACK: flimsy wiring for davRead */
1889 - if (fd->req != NULL)
1892 if ((fdno = fdFileno(fd)) < 0)
1893 return -1; /* XXX W2DO? */
1895 @@ -1758,159 +1734,6 @@
1900 -static int httpResp(urlinfo u, FD_t ctrl, /*@out@*/ char ** str)
1901 - /*@globals fileSystem @*/
1902 - /*@modifies ctrl, *str, fileSystem @*/
1908 - rc = checkResponse(u, ctrl, &ec, str);
1910 -if (_ftp_debug && !(rc == 0 && (ec == 200 || ec == 201)))
1911 -fprintf(stderr, "*** httpResp: rc %d ec %d\n", rc, ec);
1915 - case 201: /* 201 Created. */
1917 - case 204: /* HACK: if overwriting, 204 No Content. */
1918 - case 403: /* 403 Forbidden. */
1919 - ctrl->syserrno = EACCES; /* HACK */
1920 - rc = FTPERR_UNKNOWN;
1923 - rc = FTPERR_FILE_NOT_FOUND;
1929 -static int httpReq(FD_t ctrl, const char * httpCmd, const char * httpArg)
1930 - /*@globals h_errno, fileSystem, internalState @*/
1931 - /*@modifies ctrl, fileSystem, internalState @*/
1934 - const char * host;
1935 - const char * path;
1936 - char hthost[NI_MAXHOST];
1943 -assert(ctrl != NULL);
1947 - if (((host = (u->proxyh ? u->proxyh : u->host)) == NULL))
1948 - return FTPERR_BAD_HOSTNAME;
1949 - if (strchr(host, ':'))
1950 - sprintf(hthost, "[%s]", host);
1952 - strcpy(hthost, host);
1954 - if ((port = (u->proxyp > 0 ? u->proxyp : u->port)) < 0) port = 80;
1955 - path = (u->proxyh || u->proxyp > 0) ? u->url : httpArg;
1956 - /*@-branchstate@*/
1957 - if (path == NULL) path = "";
1958 - /*@=branchstate@*/
1961 - /*@-branchstate@*/
1962 - if (fdFileno(ctrl) >= 0 && (rc = fdWritable(ctrl, 0)) < 1) {
1963 - /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
1965 - /*@=branchstate@*/
1968 - if (fdFileno(ctrl) < 0) {
1969 - rc = tcpConnect(ctrl, host, port);
1972 - ctrl = fdLink(ctrl, "open ctrl (httpReq)");
1976 -req x HTTP/1.0\r\n\
1977 -User-Agent: rpm/3.0.4\r\n\
1979 -Accept: text/plain\r\n\
1980 -Transfer-Encoding: chunked\r\n\
1982 -") + strlen(httpCmd) + strlen(path) + sizeof(VERSION) + strlen(hthost) + 20;
1985 - req = alloca(len);
1988 - if (!strcmp(httpCmd, "PUT")) {
1990 -%s %s HTTP/1.%d\r\n\
1991 -User-Agent: rpm/%s\r\n\
1993 -Accept: text/plain\r\n\
1994 -Transfer-Encoding: chunked\r\n\
1996 -", httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, hthost, port);
1999 -%s %s HTTP/1.%d\r\n\
2000 -User-Agent: rpm/%s\r\n\
2002 -Accept: text/plain\r\n\
2004 -", httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, hthost, port);
2009 -fprintf(stderr, "-> %s", req);
2011 - len = strlen(req);
2012 - if (fdWrite(ctrl, req, len) != len) {
2013 - rc = FTPERR_SERVER_IO_ERROR;
2017 - /*@-branchstate@*/
2018 - if (!strcmp(httpCmd, "PUT")) {
2019 - ctrl->wr_chunked = 1;
2022 - rc = httpResp(u, ctrl, NULL);
2025 - if (!retrying) { /* not HTTP_OK */
2027 - /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
2033 - /*@=branchstate@*/
2035 - ctrl = fdLink(ctrl, "open data (httpReq)");
2039 - /*@-observertrans@*/
2040 - fdSetSyserrno(ctrl, errno, ftpStrerror(rc));
2041 - /*@=observertrans@*/
2043 - /*@-branchstate@*/
2044 - if (fdFileno(ctrl) >= 0)
2045 - /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
2046 - /*@=branchstate@*/
2052 /* XXX DYING: unused */
2053 void * ufdGetUrlinfo(FD_t fd)
2055 @@ -2268,29 +2091,6 @@
2059 - case URL_IS_HTTPS:
2062 - fd = davOpen(url, flags, mode, &u);
2063 - if (fd == NULL || u == NULL)
2066 - cmd = ((flags & O_WRONLY)
2067 - ? ((flags & O_APPEND) ? "PUT" :
2068 - ((flags & O_CREAT) ? "PUT" : "PUT"))
2070 - u->openError = davReq(fd, cmd, path);
2071 - if (u->openError < 0) {
2072 - /* XXX make sure that we can exit through ufdClose */
2073 - fd = fdLink(fd, "error ctrl (ufdOpen HTTP)");
2074 - fd = fdLink(fd, "error data (ufdOpen HTTP)");
2076 - fd->bytesRemain = ((!strcmp(cmd, "GET"))
2077 - ? fd->contentLength : -1);
2078 - fd->wr_chunked = ((!strcmp(cmd, "PUT"))
2079 - ? fd->wr_chunked : 0);
2083 assert(!(flags & O_RDWR));
2084 fd = fdDup( ((flags & O_WRONLY) ? STDOUT_FILENO : STDIN_FILENO) );
2085 @@ -2908,10 +2708,8 @@
2086 if (fd->nfps > 0 && fpno == -1 &&
2087 fd->fps[fd->nfps-1].io == ufdio &&
2088 fd->fps[fd->nfps-1].fp == fp &&
2089 - (fd->fps[fd->nfps-1].fdno >= 0 || fd->req != NULL))
2090 + (fd->fps[fd->nfps-1].fdno >= 0))
2092 - int hadreqpersist = (fd->req != NULL);
2097 @@ -2921,26 +2719,9 @@
2099 if (fdGetFdno(fd) >= 0)
2102 - hadreqpersist = 0;
2106 - /* HACK: flimsy Keepalive wiring. */
2107 - if (hadreqpersist) {
2112 -/*@-refcounttrans@*/
2113 - (void) fdClose(fd);
2114 -/*@=refcounttrans@*/
2115 - fdSetFp(fd, NULL);
2117 -/*@-refcounttrans@*/
2118 - (void) fdClose(fd);
2119 -/*@=refcounttrans@*/
2124 @@ -3195,18 +2976,9 @@
2132 /* XXX gzdio and bzdio here too */
2134 switch (urlIsURL(path)) {
2135 - case URL_IS_HTTPS:
2143 @@ -3214,7 +2986,7 @@
2145 fprintf(stderr, "*** Fopen ufdio path %s fmode %s\n", path, fmode);
2146 fd = ufdOpen(path, flags, perms);
2147 - if (fd == NULL || !(fdFileno(fd) >= 0 || fd->req != NULL))
2148 + if (fd == NULL || !(fdFileno(fd) >= 0))
2152 @@ -3223,15 +2995,6 @@
2154 /*@notreached@*/ break;
2157 - /* XXX persistent HTTP/1.1 returns the previously opened fp */
2158 - if (isHTTP && ((fp = fdGetFp(fd)) != NULL) && ((fdno = fdGetFdno(fd)) >= 0 || fd->req != NULL))
2160 - /*@+voidabstract@*/
2161 - fdPush(fd, fpio, fp, fileno(fp)); /* Push fpio onto stack */
2162 - /*@=voidabstract@*/
2168 @@ -3267,10 +3030,6 @@
2171 if (fd == NULL) return -1;
2172 - if (fd->req != NULL) {
2173 - /* HACK: flimsy wiring for neon errors. */
2174 - rc = (fd->syserrno || fd->errcookie != NULL) ? -1 : 0;
2176 for (i = fd->nfps; rc == 0 && i >= 0; i--) {
2178 FDSTACK_t * fps = &fd->fps[i];
2179 @@ -3305,9 +3064,6 @@
2183 - if (fd->req != NULL)
2184 - rc = 123456789; /* HACK: https has no steenkin fileno. */
2186 for (i = fd->nfps ; rc == -1 && i >= 0; i--) {
2188 rc = fd->fps[i].fdno;
2189 diff -ur rpm-4.4.7.org/rpmio/rpmio_internal.h rpm-4.4.7/rpmio/rpmio_internal.h
2190 --- rpm-4.4.7.org/rpmio/rpmio_internal.h 2006-06-18 20:54:59.000000000 +0200
2191 +++ rpm-4.4.7/rpmio/rpmio_internal.h 2006-10-17 22:18:51.308135000 +0200
2194 void * url; /* ufdio: URL info */
2196 - void * req; /* ufdio: HTTP request */
2198 int rd_timeoutsecs; /* ufdRead: per FD_t timer */
2199 ssize_t bytesRemain; /* ufdio: */
2200 diff -ur rpm-4.4.7.org/rpmio/rpmrpc.c rpm-4.4.7/rpmio/rpmrpc.c
2201 --- rpm-4.4.7.org/rpmio/rpmrpc.c 2006-10-03 06:38:01.000000000 +0200
2202 +++ rpm-4.4.7/rpmio/rpmrpc.c 2006-10-17 22:35:59.040364250 +0200
2205 return ftpMkdir(path, mode);
2206 /*@notreached@*/ break;
2207 - case URL_IS_HTTPS:
2209 - return davMkdir(path, mode);
2210 - /*@notreached@*/ break;
2214 @@ -118,15 +114,6 @@
2216 return ftpChdir(path);
2217 /*@notreached@*/ break;
2218 - case URL_IS_HTTPS:
2221 - return davChdir(path);
2223 - errno = EINVAL; /* XXX W2DO? */
2226 - /*@notreached@*/ break;
2230 @@ -151,10 +138,6 @@
2232 return ftpRmdir(path);
2233 /*@notreached@*/ break;
2234 - case URL_IS_HTTPS:
2236 - return davRmdir(path);
2237 - /*@notreached@*/ break;
2244 case URL_IS_FTP: /* XXX TODO: implement. */
2245 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2246 - case URL_IS_HTTP: /* XXX TODO: implement. */
2248 errno = EINVAL; /* XXX W2DO? */
2250 @@ -208,10 +189,6 @@
2252 oldut = urlPath(oldpath, &oe);
2254 - case URL_IS_HTTPS:
2256 - return davRename(oldpath, newpath);
2257 - /*@notreached@*/ break;
2258 case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
2260 case URL_IS_UNKNOWN:
2263 return ftpRename(oldpath, newpath);
2264 /*@notreached@*/ break;
2265 - case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */
2266 - case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */
2272 oldut = urlPath(oldpath, &oe);
2274 - case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */
2275 - case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */
2276 case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
2278 case URL_IS_UNKNOWN:
2281 newut = urlPath(newpath, &ne);
2283 - case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */
2284 - case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */
2285 case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
2288 @@ -306,10 +277,6 @@
2290 return ftpUnlink(path);
2291 /*@notreached@*/ break;
2292 - case URL_IS_HTTPS:
2294 - return davUnlink(path);
2295 - /*@notreached@*/ break;
2299 @@ -1308,10 +1275,6 @@
2301 return ftpStat(path, st);
2302 /*@notreached@*/ break;
2303 - case URL_IS_HTTPS:
2305 - return davStat(path, st);
2306 - /*@notreached@*/ break;
2310 @@ -1338,10 +1301,6 @@
2312 return ftpLstat(path, st);
2313 /*@notreached@*/ break;
2314 - case URL_IS_HTTPS:
2316 - return davLstat(path, st);
2317 - /*@notreached@*/ break;
2321 @@ -1373,8 +1332,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 @@ -1399,8 +1356,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 @@ -1425,8 +1380,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 @@ -1451,8 +1404,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 @@ -1477,8 +1428,6 @@
2360 case URL_IS_FTP: /* XXX TODO: implement. */
2361 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2362 - case URL_IS_HTTP: /* XXX TODO: implement. */
2364 errno = EINVAL; /* XXX W2DO? */
2366 @@ -1503,8 +1452,6 @@
2369 case URL_IS_FTP: /* XXX TODO: implement. */
2370 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2371 - case URL_IS_HTTP: /* XXX TODO: implement. */
2373 errno = EINVAL; /* XXX W2DO? */
2375 @@ -1529,8 +1476,6 @@
2378 case URL_IS_FTP: /* XXX TODO: implement. */
2379 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2380 - case URL_IS_HTTP: /* XXX TODO: implement. */
2382 errno = EINVAL; /* XXX W2DO? */
2384 @@ -1558,8 +1503,6 @@
2387 case URL_IS_FTP: /* XXX TODO: implement. */
2388 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2389 - case URL_IS_HTTP: /* XXX TODO: implement. */
2391 errno = EINVAL; /* XXX W2DO? */
2393 @@ -1577,14 +1520,6 @@
2395 return ftpReadlink(path, buf, bufsiz);
2396 /*@notreached@*/ break;
2397 - case URL_IS_HTTPS:
2400 - return davReadlink(path, buf, bufsiz);
2404 - /*@notreached@*/ break;
2408 @@ -1617,8 +1552,6 @@
2412 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2413 - case URL_IS_HTTP: /* XXX TODO: implement. */
2414 case URL_IS_FTP: /* XXX TODO: implement. */
2416 errno = EINVAL; /* XXX W2DO? */
2417 @@ -1685,8 +1618,6 @@
2418 fprintf(stderr, "*** Glob(%s,0x%x,%p,%p)\n", pattern, (unsigned)flags, (void *)errfunc, pglob);
2421 - case URL_IS_HTTPS:
2425 pglob->gl_closedir = Closedir;
2426 @@ -1730,10 +1661,6 @@
2428 return ftpOpendir(path);
2429 /*@notreached@*/ break;
2430 - case URL_IS_HTTPS:
2432 - return davOpendir(path);
2433 - /*@notreached@*/ break;
2437 @@ -1758,8 +1685,6 @@
2440 return avReaddir(dir);
2441 - if (ISDAVMAGIC(dir))
2442 - return davReaddir(dir);
2443 return readdir(dir);
2446 @@ -1771,8 +1696,6 @@
2449 return avClosedir(dir);
2450 - if (ISDAVMAGIC(dir))
2451 - return davClosedir(dir);
2452 return closedir(dir);
2455 diff -ur rpm-4.4.7.org/rpmio/tget.c rpm-4.4.7/rpmio/tget.c
2456 --- rpm-4.4.7.org/rpmio/tget.c 2004-11-19 17:52:58.000000000 +0100
2457 +++ rpm-4.4.7/rpmio/tget.c 2006-10-17 22:20:47.995427500 +0200
2460 static int _debug = 0;
2464 #define HTTPSPATH "https://localhost/test.txt"
2465 #define HTTPPATH "http://localhost/test.txt"
2466 #define FTPPATH "ftp://localhost/test.txt"
2468 { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL },
2469 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2470 N_("debug protocol data stream"), NULL},
2471 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2472 - N_("disable use of libneon for HTTP"), NULL},
2473 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2474 N_("debug rpmio I/O"), NULL},
2475 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2476 diff -ur rpm-4.4.7.org/rpmio/tglob.c rpm-4.4.7/rpmio/tglob.c
2477 --- rpm-4.4.7.org/rpmio/tglob.c 2004-11-19 17:53:05.000000000 +0100
2478 +++ rpm-4.4.7/rpmio/tglob.c 2006-10-17 22:21:01.712284750 +0200
2481 static int _debug = 0;
2485 #define HTTPSPATH "https://localhost/rawhide/test/*.rpm"
2487 #define HTTPPATH "http://localhost/rawhide/test/*.rpm"
2489 { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL },
2490 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2491 N_("debug protocol data stream"), NULL},
2492 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2493 - N_("disable use of libneon for HTTP"), NULL},
2494 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2495 N_("debug rpmio I/O"), NULL},
2496 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2497 diff -ur rpm-4.4.7.org/rpmio/thkp.c rpm-4.4.7/rpmio/thkp.c
2498 --- rpm-4.4.7.org/rpmio/thkp.c 2005-01-04 17:35:12.000000000 +0100
2499 +++ rpm-4.4.7/rpmio/thkp.c 2006-10-17 22:21:10.696846250 +0200
2501 static int _debug = 0;
2502 static int _printing = 0;
2507 #define HKPPATH "hkp://pgp.mit.edu:11371/pks/lookup?op=get&search=0xF5C75256"
2510 N_("debug protocol data stream"), NULL},
2511 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2512 N_("debug protocol data stream"), NULL},
2513 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2514 - N_("disable use of libneon for HTTP"), NULL},
2515 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2516 N_("debug rpmio I/O"), NULL},
2517 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2518 diff -ur rpm-4.4.7.org/rpmio/tput.c rpm-4.4.7/rpmio/tput.c
2519 --- rpm-4.4.7.org/rpmio/tput.c 2004-11-19 17:53:11.000000000 +0100
2520 +++ rpm-4.4.7/rpmio/tput.c 2006-10-17 22:21:25.841792750 +0200
2523 static int _debug = 0;
2527 #define HTTPSPATH "https://localhost/rawhide/toad/tput.txt"
2528 #define HTTPPATH "http://localhost/rawhide/toad/tput.txt"
2529 #define FTPPATH "ftp://localhost/home/test/tput.txt"
2531 { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL },
2532 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2533 N_("debug protocol data stream"), NULL},
2534 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2535 - N_("disable use of libneon for HTTP"), NULL},
2536 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2537 N_("debug rpmio I/O"), NULL},
2538 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2539 --- rpm-4.4.8/rpmio/url.c.orig 2007-01-20 21:33:50.000000000 +0100
2540 +++ rpm-4.4.8/rpmio/url.c 2007-04-08 19:57:45.646376012 +0200
2542 (u->scheme ? u->scheme : ""));
2546 u->buf = _free(u->buf);
2547 u->url = _free(u->url);
2548 u->scheme = _free((void *)u->scheme);
2551 { "file://", URL_IS_PATH },
2552 { "ftp://", URL_IS_FTP },
2553 - { "hkp://", URL_IS_HKP },
2554 - { "http://", URL_IS_HTTP },
2555 - { "https://", URL_IS_HTTPS },
2556 { "-", URL_IS_DASH },
2557 { NULL, URL_IS_UNKNOWN }