]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-no-neon.patch
- updated for 4.4.6
[packages/rpm.git] / rpm-no-neon.patch
1 --- rpm-4.4.2/configure.ac.orig 2005-07-23 14:06:59.692430464 +0200
2 +++ rpm-4.4.2/configure.ac      2005-07-23 14:08:45.591331384 +0200
3 @@ -516,28 +516,6 @@
4  WITH_NEON_SUBDIR=
5  WITH_NEON_INCLUDE=
6  WITH_NEON_LIB=
7 -AC_CHECK_HEADER([neon/ne_session.h], [
8 -  AC_CHECK_LIB(neon, ne_session_create, [
9 -    AC_DEFINE(HAVE_LIBNEON, 1, [Define to 1 if you have the 'neon' library (-lneon).])
10 -    AC_CHECK_LIB(neon, ne_get_response_header, [
11 -      AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, [Define to 1 if you have ne_get_response_header() in libneon.])
12 -    ])
13 -    AC_CHECK_LIB(neon, ne_send_request_chunk, [
14 -       AC_DEFINE(HAVE_NEON_NE_SEND_REQUEST_CHUNK, 1, [Define to 1 if you have ne_send_request_chunk() in libneon.])
15 -    ])
16 -    WITH_NEON_INCLUDE="-I${includedir}/neon"
17 -    WITH_NEON_LIB="-lneon"
18 -  ])
19 -],[
20 -  if test -d neon ; then
21 -    AC_DEFINE(HAVE_LIBNEON, 1, [Define to 1 if you have the 'neon' library (-lneon).])
22 -# XXX HAVE_NEON_NE_GET_RESPONSE_HEADER assumes libneon-0.25 devel internal
23 -    AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, [Define to 1 if you have ne_get_response_header() in libneon.])
24 -    WITH_NEON_SUBDIR=neon
25 -    WITH_NEON_INCLUDE="-I\${top_srcdir}/${WITH_NEON_SUBDIR}/src"
26 -    WITH_NEON_LIB="\${top_builddir}/${WITH_NEON_SUBDIR}/src/libneon.la"
27 -  fi
28 -])
29  AC_SUBST(WITH_NEON_SUBDIR)
30  AC_SUBST(WITH_NEON_INCLUDE)
31  AC_SUBST(WITH_NEON_LIB)
32 --- rpm-4.4.6/rpmio/rpmdav.c.orig       2006-03-12 20:24:23.000000000 +0100
33 +++ rpm-4.4.6/rpmio/rpmdav.c    2006-04-17 18:20:07.597482250 +0200
34 @@ -9,31 +9,6 @@
35  #include <pthread.h>
36  #endif
37  
38 -#include "ne_alloc.h"
39 -#include "ne_auth.h"
40 -#include "ne_basic.h"
41 -#include "ne_dates.h"
42 -#include "ne_locks.h"
43 -
44 -#define        NEONBLOWSCHUNKS
45 -#ifndef        NEONBLOWSCHUNKS
46 -/* HACK: include ne_private.h to access sess->socket for now. */
47 -#include "../neon/src/ne_private.h"
48 -#endif
49 -
50 -#include "ne_props.h"
51 -#include "ne_request.h"
52 -#include "ne_socket.h"
53 -#include "ne_string.h"
54 -#include "ne_utils.h"
55 -
56 -/* XXX API changes for neon-0.26.0 */
57 -#if !defined(NE_FREE)
58 -#define        ne_set_persist(_sess, _flag)
59 -#define        ne_propfind_set_private(_pfh, _create_item, NULL) \
60 -       ne_propfind_set_private(_pfh, _create_item, NULL, NULL)
61 -#endif
62 -
63  #include <rpmio_internal.h>
64  
65  #define _RPMDAV_INTERNAL
66 @@ -69,1332 +44,6 @@
67  }
68  
69  /* =============================================================== */
70 -static int davFree(urlinfo u)
71 -       /*@globals internalState @*/
72 -       /*@modifies u, internalState @*/
73 -{
74 -    if (u != NULL && u->sess != NULL) {
75 -       u->capabilities = _free(u->capabilities);
76 -       if (u->lockstore != NULL)
77 -           ne_lockstore_destroy(u->lockstore);
78 -       u->lockstore = NULL;
79 -       ne_session_destroy(u->sess);
80 -       u->sess = NULL;
81 -    }
82 -    return 0;
83 -}
84 -
85 -static void davProgress(void * userdata, off_t current, off_t total)
86 -       /*@*/
87 -{
88 -    urlinfo u = userdata;
89 -    ne_session * sess;
90 -
91 -assert(u != NULL);
92 -    sess = u->sess;
93 -assert(sess != NULL);
94 -assert(u == ne_get_session_private(sess, "urlinfo"));
95 -
96 -    u->current = current;
97 -    u->total = total;
98 -
99 -if (_dav_debug < 0)
100 -fprintf(stderr, "*** davProgress(%p,0x%x:0x%x) sess %p u %p\n", userdata, (unsigned int)current, (unsigned int)total, sess, u);
101 -}
102 -
103 -static void davNotify(void * userdata,
104 -               ne_conn_status connstatus, const char * info)
105 -       /*@*/
106 -{
107 -    urlinfo u = userdata;
108 -    ne_session * sess;
109 -    /*@observer@*/
110 -    static const char * connstates[] = {
111 -       "namelookup",
112 -       "connecting",
113 -       "connected",
114 -       "secure",
115 -       "unknown"
116 -    };
117 -
118 -assert(u != NULL);
119 -    sess = u->sess;
120 -assert(sess != NULL);
121 -assert(u == ne_get_session_private(sess, "urlinfo"));
122 -
123 -#ifdef REFERENCE
124 -typedef enum {
125 -    ne_conn_namelookup, /* lookup up hostname (info = hostname) */
126 -    ne_conn_connecting, /* connecting to host (info = hostname) */
127 -    ne_conn_connected, /* connected to host (info = hostname) */
128 -    ne_conn_secure /* connection now secure (info = crypto level) */
129 -} ne_conn_status;
130 -#endif
131 -
132 -    u->connstatus = connstatus;
133 -
134 -/*@-boundsread@*/
135 -if (_dav_debug < 0)
136 -fprintf(stderr, "*** davNotify(%p,%d,%p) sess %p u %p %s\n", userdata, connstatus, info, sess, u, connstates[ (connstatus < 4 ? connstatus : 4)]);
137 -/*@=boundsread@*/
138 -
139 -}
140 -
141 -static void davCreateRequest(ne_request * req, void * userdata,
142 -               const char * method, const char * uri)
143 -       /*@*/
144 -{
145 -    urlinfo u = userdata;
146 -    ne_session * sess;
147 -    void * private = NULL;
148 -    const char * id = "urlinfo";
149 -
150 -assert(u != NULL);
151 -assert(u->sess != NULL);
152 -assert(req != NULL);
153 -    sess = ne_get_session(req);
154 -assert(sess == u->sess);
155 -assert(u == ne_get_session_private(sess, "urlinfo"));
156 -
157 -assert(sess != NULL);
158 -    private = ne_get_session_private(sess, id);
159 -assert(u == private);
160 -
161 -if (_dav_debug < 0)
162 -fprintf(stderr, "*** davCreateRequest(%p,%p,%s,%s) %s:%p\n", req, userdata, method, uri, id, private);
163 -}
164 -
165 -static void davPreSend(ne_request * req, void * userdata, ne_buffer * buf)
166 -{
167 -    urlinfo u = userdata;
168 -    ne_session * sess;
169 -    const char * id = "fd";
170 -    FD_t fd = NULL;
171 -
172 -assert(u != NULL);
173 -assert(u->sess != NULL);
174 -assert(req != NULL);
175 -    sess = ne_get_session(req);
176 -assert(sess == u->sess);
177 -assert(u == ne_get_session_private(sess, "urlinfo"));
178 -
179 -    fd = ne_get_request_private(req, id);
180 -
181 -if (_dav_debug < 0)
182 -fprintf(stderr, "*** davPreSend(%p,%p,%p) sess %p %s %p\n", req, userdata, buf, sess, id, fd);
183 -if (_dav_debug)
184 -fprintf(stderr, "-> %s\n", buf->data);
185 -
186 -}
187 -
188 -static int davPostSend(ne_request * req, void * userdata, const ne_status * status)
189 -       /*@*/
190 -{
191 -    urlinfo u = userdata;
192 -    ne_session * sess;
193 -    const char * id = "fd";
194 -    FD_t fd = NULL;
195 -
196 -assert(u != NULL);
197 -assert(u->sess != NULL);
198 -assert(req != NULL);
199 -    sess = ne_get_session(req);
200 -assert(sess == u->sess);
201 -assert(u == ne_get_session_private(sess, "urlinfo"));
202 -
203 -    fd = ne_get_request_private(req, id);
204 -
205 -/*@-evalorder@*/
206 -if (_dav_debug < 0)
207 -fprintf(stderr, "*** davPostSend(%p,%p,%p) sess %p %s %p %s\n", req, userdata, status, sess, id, fd, ne_get_error(sess));
208 -/*@=evalorder@*/
209 -    return NE_OK;
210 -}
211 -
212 -static void davDestroyRequest(ne_request * req, void * userdata)
213 -       /*@*/
214 -{
215 -    urlinfo u = userdata;
216 -    ne_session * sess;
217 -    const char * id = "fd";
218 -    FD_t fd = NULL;
219 -
220 -assert(u != NULL);
221 -assert(u->sess != NULL);
222 -assert(req != NULL);
223 -    sess = ne_get_session(req);
224 -assert(sess == u->sess);
225 -assert(u == ne_get_session_private(sess, "urlinfo"));
226 -
227 -    fd = ne_get_request_private(req, id);
228 -
229 -if (_dav_debug < 0)
230 -fprintf(stderr, "*** davDestroyRequest(%p,%p) sess %p %s %p\n", req, userdata, sess, id, fd);
231 -}
232 -
233 -static void davDestroySession(void * userdata)
234 -       /*@*/
235 -{
236 -    urlinfo u = userdata;
237 -    ne_session * sess;
238 -    void * private = NULL;
239 -    const char * id = "urlinfo";
240 -
241 -assert(u != NULL);
242 -assert(u->sess != NULL);
243 -    sess = u->sess;
244 -assert(u == ne_get_session_private(sess, "urlinfo"));
245 -
246 -assert(sess != NULL);
247 -    private = ne_get_session_private(sess, id);
248 -assert(u == private);
249 -
250 -if (_dav_debug < 0)
251 -fprintf(stderr, "*** davDestroySession(%p) sess %p %s %p\n", userdata, sess, id, private);
252 -}
253 -
254 -static int
255 -davVerifyCert(void *userdata, int failures, const ne_ssl_certificate *cert)
256 -       /*@*/
257 -{
258 -    const char *hostname = userdata;
259 -
260 -if (_dav_debug < 0)
261 -fprintf(stderr, "*** davVerifyCert(%p,%d,%p) %s\n", userdata, failures, cert, hostname);
262 -
263 -    return 0;  /* HACK: trust all server certificates. */
264 -}
265 -
266 -static int davConnect(urlinfo u)
267 -       /*@globals internalState @*/
268 -       /*@modifies u, internalState @*/
269 -{
270 -    const char * path = NULL;
271 -    int rc;
272 -
273 -    /* HACK: hkp:// has no steenkin' options */
274 -    if (!(u->urltype == URL_IS_HTTP || u->urltype == URL_IS_HTTPS))
275 -       return 0;
276 -
277 -    /* HACK: where should server capabilities be read? */
278 -    (void) urlPath(u->url, &path);
279 -    /* HACK: perhaps capture Allow: tag, look for PUT permitted. */
280 -    rc = ne_options(u->sess, path, u->capabilities);
281 -    switch (rc) {
282 -    case NE_OK:
283 -       break;
284 -    case NE_ERROR:
285 -       /* HACK: "301 Moved Permanently" on empty subdir. */
286 -       if (!strncmp("301 ", ne_get_error(u->sess), sizeof("301 ")-1))
287 -           break;
288 -       /*@fallthrough@*/
289 -    case NE_CONNECT:
290 -    case NE_LOOKUP:
291 -    default:
292 -if (_dav_debug)
293 -fprintf(stderr, "*** Connect to %s:%d failed(%d):\n\t%s\n",
294 -                  u->host, u->port, rc, ne_get_error(u->sess));
295 -       break;
296 -    }
297 -
298 -    /* HACK: sensitive to error returns? */
299 -    u->httpVersion = (ne_version_pre_http11(u->sess) ? 0 : 1);
300 -
301 -    return rc;
302 -}
303 -
304 -static int davInit(const char * url, urlinfo * uret)
305 -       /*@globals internalState @*/
306 -       /*@modifies *uret, internalState @*/
307 -{
308 -    urlinfo u = NULL;
309 -    int rc = 0;
310 -
311 -/*@-globs@*/   /* FIX: h_errno annoyance. */
312 -    if (urlSplit(url, &u))
313 -       return -1;      /* XXX error returns needed. */
314 -/*@=globs@*/
315 -
316 -    if (u->url != NULL && u->sess == NULL)
317 -    switch (u->urltype) {
318 -    default:
319 -       assert(u->urltype != u->urltype);
320 -       /*@notreached@*/ break;
321 -    case URL_IS_HTTPS:
322 -    case URL_IS_HTTP:
323 -    case URL_IS_HKP:
324 -      {        ne_server_capabilities * capabilities;
325 -
326 -       /* HACK: oneshots should be done Somewhere Else Instead. */
327 -/*@-noeffect@*/
328 -       rc = ((_dav_debug < 0) ? NE_DBG_HTTP : 0);
329 -       ne_debug_init(stderr, rc);              /* XXX oneshot? */
330 -/*@=noeffect@*/
331 -       rc = ne_sock_init();                    /* XXX oneshot? */
332 -
333 -       u->lockstore = ne_lockstore_create();   /* XXX oneshot? */
334 -
335 -       u->capabilities = capabilities = xcalloc(1, sizeof(*capabilities));
336 -       u->sess = ne_session_create(u->scheme, u->host, u->port);
337 -
338 -       ne_lockstore_register(u->lockstore, u->sess);
339 -
340 -       if (u->proxyh != NULL)
341 -           ne_session_proxy(u->sess, u->proxyh, u->proxyp);
342 -
343 -#if 0
344 -       {   const ne_inet_addr ** addrs;
345 -           unsigned int n;
346 -           ne_set_addrlist(u->sess, addrs, n);
347 -       }
348 -#endif
349 -
350 -       ne_set_progress(u->sess, davProgress, u);
351 -       ne_set_status(u->sess, davNotify, u);
352 -
353 -       ne_set_persist(u->sess, 1);
354 -       ne_set_read_timeout(u->sess, httpTimeoutSecs);
355 -       ne_set_useragent(u->sess, PACKAGE "/" PACKAGE_VERSION);
356 -
357 -       /* XXX check that neon is ssl enabled. */
358 -       if (!strcasecmp(u->scheme, "https"))
359 -           ne_ssl_set_verify(u->sess, davVerifyCert, (char *)u->host);
360 -
361 -       ne_set_session_private(u->sess, "urlinfo", u);
362 -
363 -       ne_hook_destroy_session(u->sess, davDestroySession, u);
364 -
365 -       ne_hook_create_request(u->sess, davCreateRequest, u);
366 -       ne_hook_pre_send(u->sess, davPreSend, u);
367 -       ne_hook_post_send(u->sess, davPostSend, u);
368 -       ne_hook_destroy_request(u->sess, davDestroyRequest, u);
369 -
370 -       /* HACK: where should server capabilities be read? */
371 -       rc = davConnect(u);
372 -       if (rc)
373 -           goto exit;
374 -      }        break;
375 -    }
376 -
377 -exit:
378 -/*@-boundswrite@*/
379 -    if (rc == 0 && uret != NULL)
380 -       *uret = urlLink(u, __FUNCTION__);
381 -/*@=boundswrite@*/
382 -    u = urlFree(u, "urlSplit (davInit)");
383 -
384 -    return rc;
385 -}
386 -
387 -/* =============================================================== */
388 -enum fetch_rtype_e {
389 -    resr_normal = 0,
390 -    resr_collection,
391 -    resr_reference,
392 -    resr_error
393 -};
394 -
395 -struct fetch_resource_s {
396 -/*@dependent@*/
397 -    struct fetch_resource_s *next;
398 -    char *uri;
399 -/*@unused@*/
400 -    char *displayname;
401 -    enum fetch_rtype_e type;
402 -    size_t size;
403 -    time_t modtime;
404 -    int is_executable;
405 -    int is_vcr;    /* Is version resource. 0: no vcr, 1 checkin 2 checkout */
406 -    char *error_reason; /* error string returned for this resource */
407 -    int error_status; /* error status returned for this resource */
408 -};
409 -
410 -/*@null@*/
411 -static void *fetch_destroy_item(/*@only@*/ struct fetch_resource_s *res)
412 -       /*@modifies res @*/
413 -{
414 -    ne_free(res->uri);
415 -    ne_free(res->error_reason);
416 -    res = _free(res);
417 -    return NULL;
418 -}
419 -
420 -#ifdef UNUSED
421 -/*@null@*/
422 -static void *fetch_destroy_list(/*@only@*/ struct fetch_resource_s *res)
423 -       /*@modifies res @*/
424 -{
425 -    struct fetch_resource_s *next;
426 -/*@-branchstate@*/
427 -    for (; res != NULL; res = next) {
428 -       next = res->next;
429 -       res = fetch_destroy_item(res);
430 -    }
431 -/*@=branchstate@*/
432 -    return NULL;
433 -}
434 -#endif
435 -
436 -static void *fetch_create_item(/*@unused@*/ void *userdata, /*@unused@*/ const char *uri)
437 -        /*@*/
438 -{
439 -    struct fetch_resource_s * res = ne_calloc(sizeof(*res));
440 -    return res;
441 -}
442 -
443 -/* =============================================================== */
444 -struct fetch_context_s {
445 -/*@relnull@*/ /*@dependent@*/
446 -    struct fetch_resource_s **resrock;
447 -    const char *uri;
448 -    unsigned int include_target; /* Include resource at href */
449 -/*@refcounted@*/
450 -    urlinfo u;
451 -    int ac;
452 -    int nalloced;
453 -    ARGV_t av;
454 -    mode_t * modes;
455 -    size_t * sizes;
456 -    time_t * mtimes;
457 -};
458 -
459 -/*@null@*/
460 -static void *fetch_destroy_context(/*@only@*/ /*@null@*/ struct fetch_context_s *ctx)
461 -       /*@globals internalState @*/
462 -       /*@modifies ctx, internalState @*/
463 -{
464 -    if (ctx == NULL)
465 -       return NULL;
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);
473 -/*@-boundswrite@*/
474 -    memset(ctx, 0, sizeof(*ctx));
475 -/*@=boundswrite@*/
476 -    ctx = _free(ctx);
477 -    return NULL;
478 -}
479 -
480 -/*@null@*/
481 -static void *fetch_create_context(const char *uri)
482 -       /*@globals internalState @*/
483 -       /*@modifies internalState @*/
484 -{
485 -    struct fetch_context_s * ctx;
486 -    urlinfo u;
487 -
488 -/*@-globs@*/   /* FIX: h_errno annoyance. */
489 -    if (urlSplit(uri, &u))
490 -       return NULL;
491 -/*@=globs@*/
492 -
493 -    ctx = ne_calloc(sizeof(*ctx));
494 -    ctx->uri = xstrdup(uri);
495 -    ctx->u = urlLink(u, __FUNCTION__);
496 -    return ctx;
497 -}
498 -
499 -/*@unchecked@*/ /*@observer@*/
500 -static const ne_propname fetch_props[] = {
501 -    { "DAV:", "getcontentlength" },
502 -    { "DAV:", "getlastmodified" },
503 -    { "http://apache.org/dav/props/", "executable" },
504 -    { "DAV:", "resourcetype" },
505 -    { "DAV:", "checked-in" },
506 -    { "DAV:", "checked-out" },
507 -    { NULL, NULL }
508 -};
509 -
510 -#define ELM_resourcetype (NE_PROPS_STATE_TOP + 1)
511 -#define ELM_collection (NE_PROPS_STATE_TOP + 2)
512 -
513 -/*@unchecked@*/ /*@observer@*/
514 -static const struct ne_xml_idmap fetch_idmap[] = {
515 -    { "DAV:", "resourcetype", ELM_resourcetype },
516 -    { "DAV:", "collection", ELM_collection }
517 -};
518 -
519 -static int fetch_startelm(void *userdata, int parent,
520 -               const char *nspace, const char *name,
521 -               /*@unused@*/ const char **atts)
522 -       /*@*/
523 -{
524 -    ne_propfind_handler *pfh = userdata;
525 -    struct fetch_resource_s *r = ne_propfind_current_private(pfh);
526 -    int state = ne_xml_mapid(fetch_idmap, NE_XML_MAPLEN(fetch_idmap),
527 -                             nspace, name);
528 -
529 -    if (r == NULL ||
530 -        !((parent == NE_207_STATE_PROP && state == ELM_resourcetype) ||
531 -          (parent == ELM_resourcetype && state == ELM_collection)))
532 -        return NE_XML_DECLINE;
533 -
534 -    if (state == ELM_collection) {
535 -       r->type = resr_collection;
536 -    }
537 -
538 -    return state;
539 -}
540 -
541 -static int fetch_compare(const struct fetch_resource_s *r1,
542 -                           const struct fetch_resource_s *r2)
543 -       /*@*/
544 -{
545 -    /* Sort errors first, then collections, then alphabetically */
546 -    if (r1->type == resr_error) {
547 -       return -1;
548 -    } else if (r2->type == resr_error) {
549 -       return 1;
550 -    } else if (r1->type == resr_collection) {
551 -       if (r2->type != resr_collection) {
552 -           return -1;
553 -       } else {
554 -           return strcmp(r1->uri, r2->uri);
555 -       }
556 -    } else {
557 -       if (r2->type != resr_collection) {
558 -           return strcmp(r1->uri, r2->uri);
559 -       } else {
560 -           return 1;
561 -       }
562 -    }
563 -}
564 -
565 -static void fetch_results(void *userdata, void *uarg,
566 -                   const ne_prop_result_set *set)
567 -       /*@*/
568 -{
569 -    struct fetch_context_s *ctx = userdata;
570 -    struct fetch_resource_s *current, *previous, *newres;
571 -    const char *clength, *modtime, *isexec;
572 -    const char *checkin, *checkout;
573 -    const ne_status *status = NULL;
574 -    const char * path = NULL;
575 -
576 -#if !defined(NE_FREE)
577 -    const ne_uri * uri = uarg;
578 -    (void) urlPath(uri->path, &path);
579 -#else
580 -    const char * uri = uarg;
581 -    (void) urlPath(uri, &path);
582 -#endif
583 -    if (path == NULL)
584 -       return;
585 -
586 -    newres = ne_propset_private(set);
587 -
588 -if (_dav_debug < 0)
589 -fprintf(stderr, "==> %s in uri %s\n", path, ctx->uri);
590 -
591 -    if (ne_path_compare(ctx->uri, path) == 0 && !ctx->include_target) {
592 -       /* This is the target URI */
593 -if (_dav_debug < 0)
594 -fprintf(stderr, "==> %s skipping target resource.\n", path);
595 -       /* Free the private structure. */
596 -/*@-dependenttrans -exposetrans@*/
597 -       free(newres);
598 -/*@=dependenttrans =exposetrans@*/
599 -       return;
600 -    }
601 -
602 -    newres->uri = ne_strdup(path);
603 -
604 -/*@-boundsread@*/
605 -    clength = ne_propset_value(set, &fetch_props[0]);
606 -    modtime = ne_propset_value(set, &fetch_props[1]);
607 -    isexec = ne_propset_value(set, &fetch_props[2]);
608 -    checkin = ne_propset_value(set, &fetch_props[4]);
609 -    checkout = ne_propset_value(set, &fetch_props[5]);
610 -/*@=boundsread@*/
611 -
612 -/*@-branchstate@*/
613 -    if (clength == NULL)
614 -       status = ne_propset_status(set, &fetch_props[0]);
615 -    if (modtime == NULL)
616 -       status = ne_propset_status(set, &fetch_props[1]);
617 -/*@=branchstate@*/
618 -
619 -    if (newres->type == resr_normal && status != NULL) {
620 -       /* It's an error! */
621 -       newres->error_status = status->code;
622 -
623 -       /* Special hack for Apache 1.3/mod_dav */
624 -       if (strcmp(status->reason_phrase, "status text goes here") == 0) {
625 -           const char *desc;
626 -           if (status->code == 401) {
627 -               desc = _("Authorization Required");
628 -           } else if (status->klass == 3) {
629 -               desc = _("Redirect");
630 -           } else if (status->klass == 5) {
631 -               desc = _("Server Error");
632 -           } else {
633 -               desc = _("Unknown Error");
634 -           }
635 -           newres->error_reason = ne_strdup(desc);
636 -       } else {
637 -           newres->error_reason = ne_strdup(status->reason_phrase);
638 -       }
639 -       newres->type = resr_error;
640 -    }
641 -
642 -    if (isexec && strcasecmp(isexec, "T") == 0) {
643 -       newres->is_executable = 1;
644 -    } else {
645 -       newres->is_executable = 0;
646 -    }
647 -
648 -    if (modtime)
649 -       newres->modtime = ne_httpdate_parse(modtime);
650 -
651 -    if (clength)
652 -       newres->size = atoi(clength);
653 -
654 -    /* is vcr */
655 -    if (checkin) {
656 -       newres->is_vcr = 1;
657 -    } else if (checkout) {
658 -       newres->is_vcr = 2;
659 -    } else {
660 -       newres->is_vcr = 0;
661 -    }
662 -
663 -    for (current = *ctx->resrock, previous = NULL; current != NULL;
664 -       previous = current, current = current->next)
665 -    {
666 -       if (fetch_compare(current, newres) >= 0) {
667 -           break;
668 -       }
669 -    }
670 -    if (previous) {
671 -       previous->next = newres;
672 -    } else {
673 -/*@-boundswrite -dependenttrans @*/
674 -       *ctx->resrock = newres;
675 -/*@=boundswrite =dependenttrans @*/
676 -    }
677 -    newres->next = current;
678 -}
679 -
680 -static int davFetch(const urlinfo u, struct fetch_context_s * ctx)
681 -       /*@globals internalState @*/
682 -       /*@modifies ctx, internalState @*/
683 -{
684 -    const char * path = NULL;
685 -    int depth = 1;                                     /* XXX passed arg? */
686 -    unsigned int include_target = 0;                   /* XXX passed arg? */
687 -    struct fetch_resource_s * resitem = NULL;
688 -    struct fetch_resource_s ** resrock = &resitem;     /* XXX passed arg? */
689 -    ne_propfind_handler *pfh;
690 -    struct fetch_resource_s *current, *next;
691 -    mode_t st_mode;
692 -    int rc = 0;
693 -    int xx;
694 -
695 -    (void) urlPath(u->url, &path);
696 -    pfh = ne_propfind_create(u->sess, ctx->uri, depth);
697 -
698 -    /* HACK: need to set u->httpHasRange here. */
699 -
700 -    ctx->resrock = resrock;
701 -    ctx->include_target = include_target;
702 -
703 -    ne_xml_push_handler(ne_propfind_get_parser(pfh),
704 -                        fetch_startelm, NULL, NULL, pfh);
705 -
706 -    ne_propfind_set_private(pfh, fetch_create_item, NULL);
707 -
708 -    rc = ne_propfind_named(pfh, fetch_props, fetch_results, ctx);
709 -
710 -    ne_propfind_destroy(pfh);
711 -
712 -    for (current = resitem; current != NULL; current = next) {
713 -       const char *s, *se;
714 -       char * val;
715 -
716 -       next = current->next;
717 -
718 -       /* Collections have trailing '/' that needs trim. */
719 -       /* The top level collection is returned as well. */
720 -       se = current->uri + strlen(current->uri);
721 -       if (se[-1] == '/') {
722 -           if (strlen(current->uri) <= strlen(path)) {
723 -               current = fetch_destroy_item(current);
724 -               continue;
725 -           }
726 -           se--;
727 -       }
728 -       s = se;
729 -       while (s > current->uri && s[-1] != '/')
730 -           s--;
731 -
732 -       val = ne_strndup(s, (se - s));
733 -
734 -/*@-nullpass@*/
735 -       val = ne_path_unescape(val);
736 -/*@=nullpass@*/
737 -
738 -       xx = argvAdd(&ctx->av, val);
739 -if (_dav_debug < 0)
740 -fprintf(stderr, "*** argvAdd(%p,\"%s\")\n", &ctx->av, val);
741 -       ne_free(val);
742 -
743 -       while (ctx->ac >= ctx->nalloced) {
744 -           if (ctx->nalloced <= 0)
745 -               ctx->nalloced = 1;
746 -           ctx->nalloced *= 2;
747 -           ctx->modes = xrealloc(ctx->modes,
748 -                               (sizeof(*ctx->modes) * ctx->nalloced));
749 -           ctx->sizes = xrealloc(ctx->sizes,
750 -                               (sizeof(*ctx->sizes) * ctx->nalloced));
751 -           ctx->mtimes = xrealloc(ctx->mtimes,
752 -                               (sizeof(*ctx->mtimes) * ctx->nalloced));
753 -       }
754 -
755 -       switch (current->type) {
756 -       case resr_normal:
757 -           st_mode = S_IFREG;
758 -           /*@switchbreak@*/ break;
759 -       case resr_collection:
760 -           st_mode = S_IFDIR;
761 -           /*@switchbreak@*/ break;
762 -       case resr_reference:
763 -       case resr_error:
764 -       default:
765 -           st_mode = 0;
766 -           /*@switchbreak@*/ break;
767 -       }
768 -/*@-boundswrite@*/
769 -       ctx->modes[ctx->ac] = st_mode;
770 -       ctx->sizes[ctx->ac] = current->size;
771 -       ctx->mtimes[ctx->ac] = current->modtime;
772 -/*@=boundswrite@*/
773 -       ctx->ac++;
774 -
775 -       current = fetch_destroy_item(current);
776 -    }
777 -    ctx->resrock = NULL;       /* HACK: avoid leaving stack reference. */
778 -
779 -    return rc;
780 -}
781 -
782 -static int davNLST(struct fetch_context_s * ctx)
783 -       /*@globals internalState @*/
784 -       /*@modifies ctx, internalState @*/
785 -{
786 -    urlinfo u = NULL;
787 -    int rc;
788 -    int xx;
789 -
790 -    rc = davInit(ctx->uri, &u);
791 -    if (rc || u == NULL)
792 -       goto exit;
793 -
794 -    rc = davFetch(u, ctx);
795 -    switch (rc) {
796 -    case NE_OK:
797 -        break;
798 -    case NE_ERROR:
799 -       /* HACK: "301 Moved Permanently" on empty subdir. */
800 -       if (!strncmp("301 ", ne_get_error(u->sess), sizeof("301 ")-1))
801 -           break;
802 -       /*@fallthrough@*/
803 -    default:
804 -if (_dav_debug)
805 -fprintf(stderr, "*** Fetch from %s:%d failed:\n\t%s\n",
806 -                  u->host, u->port, ne_get_error(u->sess));
807 -        break;
808 -    }
809 -
810 -exit:
811 -    if (rc)
812 -       xx = davFree(u);
813 -    return rc;
814 -}
815 -
816 -/* =============================================================== */
817 -static int my_result(const char * msg, int ret, /*@null@*/ FILE * fp)
818 -       /*@modifies *fp @*/
819 -{
820 -    /* HACK: don't print unless debugging. */
821 -    if (_dav_debug >= 0)
822 -       return ret;
823 -    if (fp == NULL)
824 -       fp = stderr;
825 -    if (msg != NULL)
826 -       fprintf(fp, "*** %s: ", msg);
827 -
828 -    /* HACK FTPERR_NE_FOO == -NE_FOO error impedance match */
829 -#ifdef HACK
830 -    fprintf(fp, "%s: %s\n", ftpStrerror(-ret), ne_get_error(sess));
831 -#else
832 -    fprintf(fp, "%s\n", ftpStrerror(-ret));
833 -#endif
834 -    return ret;
835 -}
836 -
837 -#ifdef DYING
838 -static void hexdump(const unsigned char * buf, ssize_t len)
839 -       /*@*/
840 -{
841 -    int i;
842 -    if (len <= 0)
843 -       return;
844 -    for (i = 0; i < len; i++) {
845 -       if (i != 0 && (i%16) == 0)
846 -           fprintf(stderr, "\n");
847 -       fprintf(stderr, " %02X", buf[i]);
848 -    }
849 -    fprintf(stderr, "\n");
850 -}
851 -#endif
852 -
853 -/*@-mustmod@*/
854 -static void davAcceptRanges(void * userdata, /*@null@*/ const char * value)
855 -       /*@modifies userdata @*/
856 -{
857 -    urlinfo u = userdata;
858 -
859 -    if (!(u != NULL && value != NULL)) return;
860 -if (_dav_debug < 0)
861 -fprintf(stderr, "*** u %p Accept-Ranges: %s\n", u, value);
862 -    if (!strcmp(value, "bytes"))
863 -       u->httpHasRange = 1;
864 -    if (!strcmp(value, "none"))
865 -       u->httpHasRange = 0;
866 -}
867 -/*@=mustmod@*/
868 -
869 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
870 -static void davAllHeaders(void * userdata, const char * value)
871 -{
872 -    FD_t ctrl = userdata;
873 -
874 -    if (!(ctrl != NULL && value != NULL)) return;
875 -if (_dav_debug)
876 -fprintf(stderr, "<- %s\n", value);
877 -}
878 -#endif
879 -
880 -/*@-mustmod@*/
881 -static void davContentLength(void * userdata, /*@null@*/ const char * value)
882 -       /*@modifies userdata @*/
883 -{
884 -    FD_t ctrl = userdata;
885 -
886 -    if (!(ctrl != NULL && value != NULL)) return;
887 -if (_dav_debug < 0)
888 -fprintf(stderr, "*** fd %p Content-Length: %s\n", ctrl, value);
889 -/*@-unrecog@*/
890 -   ctrl->contentLength = strtoll(value, NULL, 10);
891 -/*@=unrecog@*/
892 -}
893 -/*@=mustmod@*/
894 -
895 -/*@-mustmod@*/
896 -static void davConnection(void * userdata, /*@null@*/ const char * value)
897 -       /*@modifies userdata @*/
898 -{
899 -    FD_t ctrl = userdata;
900 -
901 -    if (!(ctrl != NULL && value != NULL)) return;
902 -if (_dav_debug < 0)
903 -fprintf(stderr, "*** fd %p Connection: %s\n", ctrl, value);
904 -    if (!strcasecmp(value, "close"))
905 -       ctrl->persist = 0;
906 -    else if (!strcasecmp(value, "Keep-Alive"))
907 -       ctrl->persist = 1;
908 -}
909 -/*@=mustmod@*/
910 -
911 -/*@-mustmod@*/ /* HACK: stash error in *str. */
912 -int davResp(urlinfo u, FD_t ctrl, /*@unused@*/ char *const * str)
913 -{
914 -    int rc = 0;
915 -
916 -    rc = ne_begin_request(ctrl->req);
917 -    rc = my_result("ne_begin_req(ctrl->req)", rc, NULL);
918 -
919 -if (_dav_debug < 0)
920 -fprintf(stderr, "*** davResp(%p,%p,%p) sess %p req %p rc %d\n", u, ctrl, str, u->sess, ctrl->req, rc);
921 -
922 -    /* HACK FTPERR_NE_FOO == -NE_FOO error impedance match */
923 -/*@-observertrans@*/
924 -    if (rc)
925 -       fdSetSyserrno(ctrl, errno, ftpStrerror(-rc));
926 -/*@=observertrans@*/
927 -
928 -    return rc;
929 -}
930 -/*@=mustmod@*/
931 -
932 -int davReq(FD_t ctrl, const char * httpCmd, const char * httpArg)
933 -{
934 -    urlinfo u;
935 -    int rc = 0;
936 -
937 -assert(ctrl != NULL);
938 -    u = ctrl->url;
939 -    URLSANE(u);
940 -
941 -if (_dav_debug < 0)
942 -fprintf(stderr, "*** davReq(%p,%s,\"%s\") entry sess %p req %p\n", ctrl, httpCmd, (httpArg ? httpArg : ""), u->sess, ctrl->req);
943 -
944 -    ctrl->persist = (u->httpVersion > 0 ? 1 : 0);
945 -    ctrl = fdLink(ctrl, "open ctrl (davReq)");
946 -
947 -assert(u->sess != NULL);
948 -assert(ctrl->req == NULL);
949 -/*@-nullpass@*/
950 -    ctrl->req = ne_request_create(u->sess, httpCmd, httpArg);
951 -/*@=nullpass@*/
952 -assert(ctrl->req != NULL);
953 -
954 -    ne_set_request_private(ctrl->req, "fd", ctrl);
955 -
956 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
957 -    ne_add_response_header_catcher(ctrl->req, davAllHeaders, ctrl);
958 -
959 -    ne_add_response_header_handler(ctrl->req, "Content-Length",
960 -               davContentLength, ctrl);
961 -    ne_add_response_header_handler(ctrl->req, "Connection",
962 -               davConnection, ctrl);
963 -#endif
964 -
965 -    if (!strcmp(httpCmd, "PUT")) {
966 -#if defined(HAVE_NEON_NE_SEND_REQUEST_CHUNK)
967 -       ctrl->wr_chunked = 1;
968 -       ne_add_request_header(ctrl->req, "Transfer-Encoding", "chunked");
969 -       ne_set_request_chunked(ctrl->req, 1);
970 -       /* HACK: no retries if/when chunking. */
971 -       rc = davResp(u, ctrl, NULL);
972 -#else
973 -       rc = FTPERR_SERVER_IO_ERROR;
974 -#endif
975 -    } else {
976 -       /* HACK: possible Last-Modified: Tue, 02 Nov 2004 14:29:36 GMT */
977 -       /* HACK: possible ETag: "inode-size-mtime" */
978 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
979 -       ne_add_response_header_handler(ctrl->req, "Accept-Ranges",
980 -                       davAcceptRanges, u);
981 -#endif
982 -       /* HACK: possible Transfer-Encoding: on GET. */
983 -
984 -       /* HACK: other errors may need retry too. */
985 -       /* HACK: neon retries once, gud enuf. */
986 -       /* HACK: retry counter? */
987 -       do {
988 -           rc = davResp(u, ctrl, NULL);
989 -       } while (rc == NE_RETRY);
990 -    }
991 -    if (rc)
992 -       goto errxit;
993 -
994 -if (_dav_debug < 0)
995 -fprintf(stderr, "*** davReq(%p,%s,\"%s\") exit sess %p req %p rc %d\n", ctrl, httpCmd, (httpArg ? httpArg : ""), u->sess, ctrl->req, rc);
996 -
997 -#if defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
998 -    davContentLength(ctrl,
999 -               ne_get_response_header(ctrl->req, "Content-Length"));
1000 -    davConnection(ctrl,
1001 -               ne_get_response_header(ctrl->req, "Connection"));
1002 -    if (strcmp(httpCmd, "PUT"))
1003 -       davAcceptRanges(u,
1004 -               ne_get_response_header(ctrl->req, "Accept-Ranges"));
1005 -#endif
1006 -
1007 -    ctrl = fdLink(ctrl, "open data (davReq)");
1008 -    return 0;
1009 -
1010 -errxit:
1011 -/*@-observertrans@*/
1012 -    fdSetSyserrno(ctrl, errno, ftpStrerror(rc));
1013 -/*@=observertrans@*/
1014 -
1015 -    /* HACK balance fd refs. ne_session_destroy to tear down non-keepalive? */
1016 -    ctrl = fdLink(ctrl, "error data (davReq)");
1017 -
1018 -    return rc;
1019 -}
1020 -
1021 -FD_t davOpen(const char * url, /*@unused@*/ int flags,
1022 -               /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
1023 -{
1024 -    const char * path = NULL;
1025 -    urltype urlType = urlPath(url, &path);
1026 -    urlinfo u = NULL;
1027 -    FD_t fd = NULL;
1028 -    int rc;
1029 -
1030 -#if 0  /* XXX makeTempFile() heartburn */
1031 -    assert(!(flags & O_RDWR));
1032 -#endif
1033 -
1034 -if (_dav_debug < 0)
1035 -fprintf(stderr, "*** davOpen(%s,0x%x,0%o,%p)\n", url, flags, mode, uret);
1036 -    rc = davInit(url, &u);
1037 -    if (rc || u == NULL || u->sess == NULL)
1038 -       goto exit;
1039 -
1040 -    if (u->ctrl == NULL)
1041 -       u->ctrl = fdNew("persist ctrl (davOpen)");
1042 -    if (u->ctrl->nrefs > 2 && u->data == NULL)
1043 -       u->data = fdNew("persist data (davOpen)");
1044 -
1045 -    if (u->ctrl->url == NULL)
1046 -       fd = fdLink(u->ctrl, "grab ctrl (davOpen persist ctrl)");
1047 -    else if (u->data->url == NULL)
1048 -       fd = fdLink(u->data, "grab ctrl (davOpen persist data)");
1049 -    else
1050 -       fd = fdNew("grab ctrl (davOpen)");
1051 -
1052 -    if (fd) {
1053 -       fdSetOpen(fd, url, flags, mode);
1054 -       fdSetIo(fd, ufdio);
1055 -
1056 -       fd->ftpFileDoneNeeded = 0;
1057 -       fd->rd_timeoutsecs = httpTimeoutSecs;
1058 -       fd->contentLength = fd->bytesRemain = -1;
1059 -       fd->url = urlLink(u, "url (davOpen)");
1060 -       fd = fdLink(fd, "grab data (davOpen)");
1061 -assert(urlType == URL_IS_HTTPS || urlType == URL_IS_HTTP || urlType == URL_IS_HKP);
1062 -       fd->urlType = urlType;
1063 -    }
1064 -
1065 -exit:
1066 -/*@-boundswrite@*/
1067 -    if (uret)
1068 -       *uret = u;
1069 -/*@=boundswrite@*/
1070 -    /*@-refcounttrans@*/
1071 -    return fd;
1072 -    /*@=refcounttrans@*/
1073 -}
1074 -
1075 -ssize_t davRead(void * cookie, /*@out@*/ char * buf, size_t count)
1076 -{
1077 -    FD_t fd = cookie;
1078 -    ssize_t rc;
1079 -
1080 -#if 0
1081 -assert(count >= 128);  /* HACK: see ne_request.h comment */
1082 -#endif
1083 -    rc = ne_read_response_block(fd->req, buf, count);
1084 -
1085 -if (_dav_debug < 0) {
1086 -fprintf(stderr, "*** davRead(%p,%p,0x%x) rc 0x%x\n", cookie, buf, (unsigned)count, (unsigned)rc);
1087 -#ifdef DYING
1088 -hexdump(buf, rc);
1089 -#endif
1090 -    }
1091 -
1092 -    return rc;
1093 -}
1094 -
1095 -ssize_t davWrite(void * cookie, const char * buf, size_t count)
1096 -{
1097 -    FD_t fd = cookie;
1098 -    ssize_t rc;
1099 -    int xx;
1100 -
1101 -#if !defined(NEONBLOWSCHUNKS)
1102 -    ne_session * sess;
1103 -
1104 -assert(fd->req != NULL);
1105 -    sess = ne_get_session(fd->req);
1106 -assert(sess != NULL);
1107 -
1108 -    /* HACK: include ne_private.h to access sess->socket for now. */
1109 -    xx = ne_sock_fullwrite(sess->socket, buf, count);
1110 -#else
1111 -#if defined(HAVE_NEON_NE_SEND_REQUEST_CHUNK) || defined(__LCLINT__)
1112 -assert(fd->req != NULL);
1113 -    xx = ne_send_request_chunk(fd->req, buf, count);
1114 -#else
1115 -    errno = EIO;       /* HACK */
1116 -    return -1;
1117 -#endif
1118 -#endif
1119 -
1120 -    /* HACK: stupid error impedence matching. */
1121 -    rc = (xx == 0 ? count : -1);
1122 -
1123 -if (_dav_debug < 0)
1124 -fprintf(stderr, "*** davWrite(%p,%p,0x%x) rc 0x%x\n", cookie, buf, (unsigned)count, (unsigned)rc);
1125 -#ifdef DYING
1126 -if (count > 0)
1127 -hexdump(buf, count);
1128 -#endif
1129 -
1130 -    return rc;
1131 -}
1132 -
1133 -int davSeek(void * cookie, /*@unused@*/ _libio_pos_t pos, int whence)
1134 -{
1135 -if (_dav_debug < 0)
1136 -fprintf(stderr, "*** davSeek(%p,pos,%d)\n", cookie, whence);
1137 -    return -1;
1138 -}
1139 -
1140 -/*@-mustmod@*/ /* HACK: fd->req is modified. */
1141 -int davClose(void * cookie)
1142 -{
1143 -/*@-onlytrans@*/
1144 -    FD_t fd = cookie;
1145 -/*@=onlytrans@*/
1146 -    int rc;
1147 -
1148 -assert(fd->req != NULL);
1149 -    rc = ne_end_request(fd->req);
1150 -    rc = my_result("ne_end_request(req)", rc, NULL);
1151 -
1152 -    ne_request_destroy(fd->req);
1153 -    fd->req = NULL;
1154 -
1155 -if (_dav_debug < 0)
1156 -fprintf(stderr, "*** davClose(%p) rc %d\n", fd, rc);
1157 -    return rc;
1158 -}
1159 -/*@=mustmod@*/
1160 -
1161 -/* =============================================================== */
1162 -int davMkdir(const char * path, mode_t mode)
1163 -{
1164 -    urlinfo u = NULL;
1165 -    const char * src = NULL;
1166 -    int rc;
1167 -
1168 -    rc = davInit(path, &u);
1169 -    if (rc)
1170 -       goto exit;
1171 -
1172 -    (void) urlPath(path, &src);
1173 -
1174 -    rc = ne_mkcol(u->sess, path);
1175 -
1176 -    if (rc) rc = -1;   /* XXX HACK: errno impedance match */
1177 -
1178 -    /* XXX HACK: verify getrestype(remote) == resr_collection */
1179 -
1180 -exit:
1181 -if (_dav_debug)
1182 -fprintf(stderr, "*** davMkdir(%s,0%o) rc %d\n", path, mode, rc);
1183 -    return rc;
1184 -}
1185 -
1186 -int davRmdir(const char * path)
1187 -{
1188 -    urlinfo u = NULL;
1189 -    const char * src = NULL;
1190 -    int rc;
1191 -
1192 -    rc = davInit(path, &u);
1193 -    if (rc)
1194 -       goto exit;
1195 -
1196 -    (void) urlPath(path, &src);
1197 -
1198 -    /* XXX HACK: only getrestype(remote) == resr_collection */
1199 -
1200 -    rc = ne_delete(u->sess, path);
1201 -
1202 -    if (rc) rc = -1;   /* XXX HACK: errno impedance match */
1203 -
1204 -exit:
1205 -if (_dav_debug)
1206 -fprintf(stderr, "*** davRmdir(%s) rc %d\n", path, rc);
1207 -    return rc;
1208 -}
1209 -
1210 -int davRename(const char * oldpath, const char * newpath)
1211 -{
1212 -    urlinfo u = NULL;
1213 -    const char * src = NULL;
1214 -    const char * dst = NULL;
1215 -    int overwrite = 1;         /* HACK: set this correctly. */
1216 -    int rc;
1217 -
1218 -    rc = davInit(oldpath, &u);
1219 -    if (rc)
1220 -       goto exit;
1221 -
1222 -    (void) urlPath(oldpath, &src);
1223 -    (void) urlPath(newpath, &dst);
1224 -
1225 -    /* XXX HACK: only getrestype(remote) != resr_collection */
1226 -
1227 -    rc = ne_move(u->sess, overwrite, src, dst);
1228 -
1229 -    if (rc) rc = -1;   /* XXX HACK: errno impedance match */
1230 -
1231 -exit:
1232 -if (_dav_debug)
1233 -fprintf(stderr, "*** davRename(%s,%s) rc %d\n", oldpath, newpath, rc);
1234 -    return rc;
1235 -}
1236 -
1237 -int davUnlink(const char * path)
1238 -{
1239 -    urlinfo u = NULL;
1240 -    const char * src = NULL;
1241 -    int rc;
1242 -
1243 -    rc = davInit(path, &u);
1244 -    if (rc)
1245 -       goto exit;
1246 -
1247 -    (void) urlPath(path, &src);
1248 -
1249 -    /* XXX HACK: only getrestype(remote) != resr_collection */
1250 -
1251 -    rc = ne_delete(u->sess, src);
1252 -
1253 -exit:
1254 -    if (rc) rc = -1;   /* XXX HACK: errno impedance match */
1255 -
1256 -if (_dav_debug)
1257 -fprintf(stderr, "*** davUnlink(%s) rc %d\n", path, rc);
1258 -    return rc;
1259 -}
1260 -
1261 -#ifdef NOTYET
1262 -static int davChdir(const char * path)
1263 -       /*@globals h_errno, fileSystem, internalState @*/
1264 -       /*@modifies fileSystem, internalState @*/
1265 -{
1266 -    return davCommand("CWD", path, NULL);
1267 -}
1268 -#endif /* NOTYET */
1269 -
1270 -/* =============================================================== */
1271 -
1272 -static const char * statstr(const struct stat * st,
1273 -               /*@returned@*/ /*@out@*/ char * buf)
1274 -       /*@modifies *buf @*/
1275 -{
1276 -    sprintf(buf,
1277 -       "*** dev %x ino %x mode %0o nlink %d uid %d gid %d rdev %x size %x\n",
1278 -       (unsigned)st->st_dev,
1279 -       (unsigned)st->st_ino,
1280 -       st->st_mode,
1281 -       (unsigned)st->st_nlink,
1282 -       st->st_uid,
1283 -       st->st_gid,
1284 -       (unsigned)st->st_rdev,
1285 -       (unsigned)st->st_size);
1286 -    return buf;
1287 -}
1288 -
1289 -/*@unchecked@*/
1290 -static int dav_st_ino = 0xdead0000;
1291 -
1292 -/*@-boundswrite@*/
1293 -int davStat(const char * path, /*@out@*/ struct stat *st)
1294 -       /*@globals dav_st_ino, fileSystem, internalState @*/
1295 -       /*@modifies *st, dav_st_ino, fileSystem, internalState @*/
1296 -{
1297 -    struct fetch_context_s * ctx = NULL;
1298 -    char buf[1024];
1299 -    int rc = -1;
1300 -
1301 -/* HACK: neon really wants collections with trailing '/' */
1302 -    ctx = fetch_create_context(path);
1303 -    if (ctx == NULL) {
1304 -/* HACK: errno = ??? */
1305 -       goto exit;
1306 -    }
1307 -    rc = davNLST(ctx);
1308 -    if (rc) {
1309 -/* HACK: errno = ??? */
1310 -       goto exit;
1311 -    }
1312 -
1313 -    memset(st, 0, sizeof(*st));
1314 -    st->st_mode = ctx->modes[0];
1315 -    st->st_size = ctx->sizes[0];
1316 -    st->st_mtime = ctx->mtimes[0];
1317 -    if (S_ISDIR(st->st_mode)) {
1318 -       st->st_nlink = 2;
1319 -       st->st_mode |= 0755;
1320 -    } else
1321 -    if (S_ISREG(st->st_mode)) {
1322 -       st->st_nlink = 1;
1323 -       st->st_mode |= 0644;
1324 -    }
1325 -
1326 -    /* XXX fts(3) needs/uses st_ino, make something up for now. */
1327 -    if (st->st_ino == 0)
1328 -       st->st_ino = dav_st_ino++;
1329 -if (_dav_debug < 0)
1330 -fprintf(stderr, "*** davStat(%s) rc %d\n%s", path, rc, statstr(st, buf));
1331 -exit:
1332 -    ctx = fetch_destroy_context(ctx);
1333 -    return rc;
1334 -}
1335 -/*@=boundswrite@*/
1336 -
1337 -/*@-boundswrite@*/
1338 -int davLstat(const char * path, /*@out@*/ struct stat *st)
1339 -       /*@globals dav_st_ino, fileSystem, internalState @*/
1340 -       /*@modifies *st, dav_st_ino, fileSystem, internalState @*/
1341 -{
1342 -    struct fetch_context_s * ctx = NULL;
1343 -    char buf[1024];
1344 -    int rc = -1;
1345 -
1346 -/* HACK: neon really wants collections with trailing '/' */
1347 -    ctx = fetch_create_context(path);
1348 -    if (ctx == NULL) {
1349 -/* HACK: errno = ??? */
1350 -       goto exit;
1351 -    }
1352 -    rc = davNLST(ctx);
1353 -    if (rc) {
1354 -/* HACK: errno = ??? */
1355 -       goto exit;
1356 -    }
1357 -
1358 -    memset(st, 0, sizeof(*st));
1359 -    st->st_mode = ctx->modes[0];
1360 -    st->st_size = ctx->sizes[0];
1361 -    st->st_mtime = ctx->mtimes[0];
1362 -    if (S_ISDIR(st->st_mode)) {
1363 -       st->st_nlink = 2;
1364 -       st->st_mode |= 0755;
1365 -    } else
1366 -    if (S_ISREG(st->st_mode)) {
1367 -       st->st_nlink = 1;
1368 -       st->st_mode |= 0644;
1369 -    }
1370 -
1371 -    /* XXX fts(3) needs/uses st_ino, make something up for now. */
1372 -    if (st->st_ino == 0)
1373 -       st->st_ino = dav_st_ino++;
1374 -if (_dav_debug < 0)
1375 -fprintf(stderr, "*** davLstat(%s) rc %d\n%s\n", path, rc, statstr(st, buf));
1376 -exit:
1377 -    ctx = fetch_destroy_context(ctx);
1378 -    return rc;
1379 -}
1380 -/*@=boundswrite@*/
1381 -
1382 -#ifdef NOTYET
1383 -static int davReadlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
1384 -       /*@globals h_errno, fileSystem, internalState @*/
1385 -       /*@modifies *buf, fileSystem, internalState @*/
1386 -{
1387 -    int rc;
1388 -    rc = davNLST(path, DO_FTP_READLINK, NULL, buf, bufsiz);
1389 -if (_dav_debug < 0)
1390 -fprintf(stderr, "*** davReadlink(%s) rc %d\n", path, rc);
1391 -    return rc;
1392 -}
1393 -#endif /* NOTYET */
1394 -
1395 -/* =============================================================== */
1396  /*@unchecked@*/
1397  int avmagicdir = 0x3607113;
1398  
1399 @@ -1517,172 +166,3 @@
1400  /*@=kepttrans@*/
1401  }
1402  /*@=boundswrite@*/
1403 -
1404 -/* =============================================================== */
1405 -/*@unchecked@*/
1406 -int davmagicdir = 0x8440291;
1407 -
1408 -int davClosedir(/*@only@*/ DIR * dir)
1409 -{
1410 -    DAVDIR avdir = (DAVDIR)dir;
1411 -
1412 -if (_dav_debug < 0)
1413 -fprintf(stderr, "*** davClosedir(%p)\n", avdir);
1414 -
1415 -#if defined(HAVE_PTHREAD_H)
1416 -/*@-moduncon -noeffectuncon @*/
1417 -    (void) pthread_mutex_destroy(&avdir->lock);
1418 -/*@=moduncon =noeffectuncon @*/
1419 -#endif
1420 -
1421 -    avdir = _free(avdir);
1422 -    return 0;
1423 -}
1424 -
1425 -struct dirent * davReaddir(DIR * dir)
1426 -{
1427 -    DAVDIR avdir = (DAVDIR)dir;
1428 -    struct dirent * dp;
1429 -    const char ** av;
1430 -    unsigned char * dt;
1431 -    int ac;
1432 -    int i;
1433 -
1434 -    if (avdir == NULL || !ISDAVMAGIC(avdir) || avdir->data == NULL) {
1435 -       /* XXX TODO: EBADF errno. */
1436 -       return NULL;
1437 -    }
1438 -
1439 -    dp = (struct dirent *) avdir->data;
1440 -    av = (const char **) (dp + 1);
1441 -    ac = avdir->size;
1442 -    dt = (char *) (av + (ac + 1));
1443 -    i = avdir->offset + 1;
1444 -
1445 -/*@-boundsread@*/
1446 -    if (i < 0 || i >= ac || av[i] == NULL)
1447 -       return NULL;
1448 -/*@=boundsread@*/
1449 -
1450 -    avdir->offset = i;
1451 -
1452 -    /* XXX glob(3) uses REAL_DIR_ENTRY(dp) test on d_ino */
1453 -/*@-type@*/
1454 -    dp->d_ino = i + 1;         /* W2DO? */
1455 -    dp->d_reclen = 0;          /* W2DO? */
1456 -
1457 -#if !(defined(hpux) || defined(__hpux) || defined(sun))
1458 -#if !defined(__APPLE__)
1459 -    dp->d_off = 0;             /* W2DO? */
1460 -#endif
1461 -/*@-boundsread@*/
1462 -    dp->d_type = dt[i];
1463 -/*@=boundsread@*/
1464 -#endif
1465 -/*@=type@*/
1466 -
1467 -    strncpy(dp->d_name, av[i], sizeof(dp->d_name));
1468 -if (_dav_debug < 0)
1469 -fprintf(stderr, "*** davReaddir(%p) %p \"%s\"\n", (void *)avdir, dp, dp->d_name);
1470 -
1471 -    return dp;
1472 -}
1473 -
1474 -/*@-boundswrite@*/
1475 -DIR * davOpendir(const char * path)
1476 -{
1477 -    struct fetch_context_s * ctx;
1478 -    DAVDIR avdir;
1479 -    struct dirent * dp;
1480 -    size_t nb;
1481 -    const char ** av, ** nav;
1482 -    unsigned char * dt;
1483 -    char * t;
1484 -    int ac, nac;
1485 -    int rc;
1486 -
1487 -    /* HACK: glob does not pass dirs with trailing '/' */
1488 -    nb = strlen(path)+1;
1489 -/*@-branchstate@*/
1490 -    if (path[nb-1] != '/') {
1491 -       char * npath = alloca(nb+1);
1492 -       *npath = '\0';
1493 -       (void) stpcpy( stpcpy(npath, path), "/");
1494 -       path = npath;
1495 -    }
1496 -/*@=branchstate@*/
1497 -
1498 -if (_dav_debug < 0)
1499 -fprintf(stderr, "*** davOpendir(%s)\n", path);
1500 -
1501 -    /* Load DAV collection into argv. */
1502 -    ctx = fetch_create_context(path);
1503 -    if (ctx == NULL) {
1504 -/* HACK: errno = ??? */
1505 -       return NULL;
1506 -    }
1507 -    rc = davNLST(ctx);
1508 -    if (rc) {
1509 -/* HACK: errno = ??? */
1510 -       return NULL;
1511 -    }
1512 -
1513 -    nb = 0;
1514 -    ac = 0;
1515 -    av = ctx->av;
1516 -    if (av != NULL)
1517 -    while (av[ac] != NULL)
1518 -       nb += strlen(av[ac++]) + 1;
1519 -    ac += 2;   /* for "." and ".." */
1520 -    nb += sizeof(".") + sizeof("..");
1521 -
1522 -    nb += sizeof(*avdir) + sizeof(*dp) + ((ac + 1) * sizeof(*av)) + (ac + 1);
1523 -    avdir = xcalloc(1, nb);
1524 -    /*@-abstract@*/
1525 -    dp = (struct dirent *) (avdir + 1);
1526 -    nav = (const char **) (dp + 1);
1527 -    dt = (char *) (nav + (ac + 1));
1528 -    t = (char *) (dt + ac + 1);
1529 -    /*@=abstract@*/
1530 -
1531 -    avdir->fd = davmagicdir;
1532 -/*@-usereleased@*/
1533 -    avdir->data = (char *) dp;
1534 -/*@=usereleased@*/
1535 -    avdir->allocation = nb;
1536 -    avdir->size = ac;
1537 -    avdir->offset = -1;
1538 -    avdir->filepos = 0;
1539 -
1540 -#if defined(HAVE_PTHREAD_H)
1541 -/*@-moduncon -noeffectuncon -nullpass @*/
1542 -    (void) pthread_mutex_init(&avdir->lock, NULL);
1543 -/*@=moduncon =noeffectuncon =nullpass @*/
1544 -#endif
1545 -
1546 -    nac = 0;
1547 -/*@-dependenttrans -unrecog@*/
1548 -    dt[nac] = DT_DIR;  nav[nac++] = t; t = stpcpy(t, ".");     t++;
1549 -    dt[nac] = DT_DIR;  nav[nac++] = t; t = stpcpy(t, "..");    t++;
1550 -/*@=dependenttrans =unrecog@*/
1551 -
1552 -    /* Copy DAV items into DIR elments. */
1553 -    ac = 0;
1554 -    if (av != NULL)
1555 -    while (av[ac] != NULL) {
1556 -       nav[nac] = t;
1557 -       dt[nac] = (S_ISDIR(ctx->modes[ac]) ? DT_DIR : DT_REG);
1558 -       t = stpcpy(t, av[ac]);
1559 -       ac++;
1560 -       t++;
1561 -       nac++;
1562 -    }
1563 -    nav[nac] = NULL;
1564 -
1565 -    ctx = fetch_destroy_context(ctx);
1566 -
1567 -/*@-kepttrans@*/
1568 -    return (DIR *) avdir;
1569 -/*@=kepttrans@*/
1570 -}
1571 -/*@=modfilesys@*/
1572 --- rpm-4.4.3/rpmio/rpmdav.h.orig       2005-10-11 21:13:59.000000000 +0200
1573 +++ rpm-4.4.3/rpmio/rpmdav.h    2005-11-19 01:07:54.224769056 +0100
1574 @@ -80,133 +80,6 @@
1575         /*@globals fileSystem, internalState @*/
1576         /*@modifies fileSystem, internalState @*/;
1577  
1578 -/**
1579 - * Send a http request.
1580 - * @param ctrl         
1581 - * @param httpCmd      http command
1582 - * @param httpArg      http command argument (NULL if none)
1583 - * @returns            0 on success
1584 - */
1585 -int davReq(FD_t ctrl, const char * httpCmd, /*@null@*/ const char * httpArg)
1586 -       /*@globals fileSystem, internalState @*/
1587 -       /*@modifies ctrl, fileSystem, internalState @*/;
1588 -
1589 -/**
1590 - * Read a http response.
1591 - * @param u
1592 - * @param cntl         
1593 - * @retval *str                error msg               
1594 - * @returns            0 on success
1595 - */
1596 -/*@-exportlocal@*/
1597 -int davResp(urlinfo u, FD_t ctrl, /*@out@*/ /*@null@*/ char *const * str)
1598 -       /*@globals fileSystem, internalState @*/
1599 -       /*@modifies ctrl, *str, fileSystem, internalState @*/;
1600 -/*@=exportlocal@*/
1601 -
1602 -/**
1603 - */
1604 -/*@null@*/
1605 -FD_t davOpen(const char * url, /*@unused@*/ int flags,
1606 -               /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
1607 -        /*@globals internalState @*/
1608 -        /*@modifies *uret, internalState @*/;
1609 -
1610 -/**
1611 - */
1612 -/*@-incondefs@*/
1613 -ssize_t davRead(void * cookie, /*@out@*/ char * buf, size_t count)
1614 -        /*@globals fileSystem, internalState @*/
1615 -        /*@modifies buf, fileSystem, internalState @*/
1616 -       /*@requires maxSet(buf) >= (count - 1) @*/
1617 -       /*@ensures maxRead(buf) == result @*/;
1618 -/*@=incondefs@*/
1619 -
1620 -/**
1621 - */
1622 -ssize_t davWrite(void * cookie, const char * buf, size_t count)
1623 -        /*@globals fileSystem, internalState @*/
1624 -        /*@modifies fileSystem, internalState @*/;
1625 -
1626 -/**
1627 - */
1628 -int davSeek(void * cookie, _libio_pos_t pos, int whence)
1629 -        /*@globals fileSystem, internalState @*/
1630 -        /*@modifies fileSystem, internalState @*/;
1631 -
1632 -/**
1633 - */
1634 -int davClose(void * cookie)
1635 -       /*@globals fileSystem, internalState @*/
1636 -       /*@modifies cookie, fileSystem, internalState @*/;
1637 -
1638 -/**
1639 - */
1640 -int davMkdir(const char * path, mode_t mode)
1641 -       /*@globals fileSystem, internalState @*/
1642 -       /*@modifies fileSystem, internalState @*/;
1643 -
1644 -/**
1645 - */
1646 -int davRmdir(const char * path)
1647 -       /*@globals fileSystem, internalState @*/
1648 -       /*@modifies fileSystem, internalState @*/;
1649 -
1650 -/**
1651 - */
1652 -int davRename(const char * oldpath, const char * newpath)
1653 -       /*@globals fileSystem, internalState @*/
1654 -       /*@modifies fileSystem, internalState @*/;
1655 -
1656 -/**
1657 - */
1658 -int davUnlink(const char * path)
1659 -       /*@globals fileSystem, internalState @*/
1660 -       /*@modifies fileSystem, internalState @*/;
1661 -
1662 -/**
1663 - * Close a DAV collection.
1664 - * @param dir          argv DIR
1665 - * @return             0 always
1666 - */
1667 -int davClosedir(/*@only@*/ DIR * dir)
1668 -       /*@globals fileSystem @*/
1669 -       /*@modifies dir, fileSystem @*/;
1670 -
1671 -/**
1672 - * Return next entry from a DAV collection.
1673 - * @param dir          argv DIR
1674 - * @return             next entry
1675 - */
1676 -/*@dependent@*/ /*@null@*/
1677 -struct dirent * davReaddir(DIR * dir)
1678 -       /*@globals fileSystem @*/
1679 -       /*@modifies fileSystem @*/;
1680 -
1681 -/**
1682 - * Create an argv directory from DAV collection.
1683 - * @param path         URL for DAV collection path
1684 - * @return             argv DIR
1685 - */
1686 -/*@null@*/
1687 -DIR * davOpendir(const char * path)
1688 -       /*@globals fileSystem, internalState @*/
1689 -       /*@modifies fileSystem, internalState @*/;
1690 -
1691 -/**
1692 - * stat(2) clone.
1693 - */
1694 -int davStat(const char * path, /*@out@*/ struct stat * st)
1695 -       /*@globals fileSystem, internalState @*/
1696 -       /*@modifies *st, fileSystem, internalState @*/;
1697 -
1698 -/**
1699 - * lstat(2) clone.
1700 - */
1701 -int davLstat(const char * path, /*@out@*/ struct stat * st)
1702 -       /*@globals fileSystem, internalState @*/
1703 -       /*@modifies *st, fileSystem, internalState @*/;
1704 -
1705  #ifdef __cplusplus
1706  }
1707  #endif
1708 --- rpm-4.4.3/rpmio/rpmio.c.orig        2005-11-16 01:05:39.000000000 +0100
1709 +++ rpm-4.4.3/rpmio/rpmio.c     2005-11-19 01:03:10.769860752 +0100
1710 @@ -371,13 +371,6 @@
1711  
1712      fdstat_enter(fd, FDSTAT_READ);
1713  /*@-boundswrite@*/
1714 -    /* HACK: flimsy wiring for davRead */
1715 -    if (fd->req != NULL) {
1716 -       rc = davRead(fd, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1717 -       /* XXX Chunked davRead EOF. */
1718 -       if (rc == 0)
1719 -           fd->bytesRemain = 0;
1720 -    } else
1721         rc = read(fdFileno(fd), buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1722  /*@=boundswrite@*/
1723      fdstat_exit(fd, FDSTAT_READ, rc);
1724 @@ -405,10 +398,6 @@
1725  
1726      fdstat_enter(fd, FDSTAT_WRITE);
1727  /*@-boundsread@*/
1728 -    /* HACK: flimsy wiring for davWrite */
1729 -    if (fd->req != NULL)
1730 -       rc = davWrite(fd, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1731 -    else
1732         rc = write(fdno, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1733  /*@=boundsread@*/
1734      fdstat_exit(fd, FDSTAT_WRITE, rc);
1735 @@ -455,11 +444,6 @@
1736      fdSetFdno(fd, -1);
1737  
1738      fdstat_enter(fd, FDSTAT_CLOSE);
1739 -    /* HACK: flimsy wiring for davClose */
1740 -/*@-branchstate@*/
1741 -    if (fd->req != NULL)
1742 -       rc = davClose(fd);
1743 -    else
1744         rc = ((fdno >= 0) ? close(fdno) : -2);
1745  /*@=branchstate@*/
1746      fdstat_exit(fd, FDSTAT_CLOSE, rc);
1747 @@ -512,10 +496,6 @@
1748      FD_ZERO(&wrfds);
1749  #endif
1750         
1751 -    /* HACK: flimsy wiring for davWrite */
1752 -    if (fd->req != NULL)
1753 -       return 1;
1754 -
1755      if ((fdno = fdFileno(fd)) < 0)
1756         return -1;      /* XXX W2DO? */
1757         
1758 @@ -567,10 +547,6 @@
1759      FD_ZERO(&rdfds);
1760  #endif
1761  
1762 -    /* HACK: flimsy wiring for davRead */
1763 -    if (fd->req != NULL)
1764 -       return 1;
1765 -
1766      if ((fdno = fdFileno(fd)) < 0)
1767         return -1;      /* XXX W2DO? */
1768         
1769 @@ -1566,154 +1542,6 @@
1770      return rc;
1771  }
1772  
1773 -#ifdef DEAD
1774 -static int httpResp(urlinfo u, FD_t ctrl, /*@out@*/ char ** str)
1775 -       /*@globals fileSystem @*/
1776 -       /*@modifies ctrl, *str, fileSystem @*/
1777 -{
1778 -    int ec = 0;
1779 -    int rc;
1780 -
1781 -    URLSANE(u);
1782 -    rc = checkResponse(u, ctrl, &ec, str);
1783 -
1784 -if (_ftp_debug && !(rc == 0 && (ec == 200 || ec == 201)))
1785 -fprintf(stderr, "*** httpResp: rc %d ec %d\n", rc, ec);
1786 -
1787 -    switch (ec) {
1788 -    case 200:
1789 -    case 201:                  /* 201 Created. */
1790 -       break;
1791 -    case 204:                  /* HACK: if overwriting, 204 No Content. */
1792 -    case 403:                  /* 403 Forbidden. */
1793 -       ctrl->syserrno = EACCES;        /* HACK */
1794 -       rc = FTPERR_UNKNOWN;
1795 -       break;
1796 -    default:
1797 -       rc = FTPERR_FILE_NOT_FOUND;
1798 -       break;
1799 -    }
1800 -    return rc;
1801 -}
1802 -
1803 -static int httpReq(FD_t ctrl, const char * httpCmd, const char * httpArg)
1804 -       /*@globals h_errno, fileSystem, internalState @*/
1805 -       /*@modifies ctrl, fileSystem, internalState @*/
1806 -{
1807 -    urlinfo u;
1808 -    const char * host;
1809 -    const char * path;
1810 -    int port;
1811 -    int rc;
1812 -    char * req;
1813 -    size_t len;
1814 -    int retrying = 0;
1815 -
1816 -assert(ctrl != NULL);
1817 -    u = ctrl->url;
1818 -    URLSANE(u);
1819 -
1820 -    if (((host = (u->proxyh ? u->proxyh : u->host)) == NULL))
1821 -       return FTPERR_BAD_HOSTNAME;
1822 -
1823 -    if ((port = (u->proxyp > 0 ? u->proxyp : u->port)) < 0) port = 80;
1824 -    path = (u->proxyh || u->proxyp > 0) ? u->url : httpArg;
1825 -    /*@-branchstate@*/
1826 -    if (path == NULL) path = "";
1827 -    /*@=branchstate@*/
1828 -
1829 -reopen:
1830 -    /*@-branchstate@*/
1831 -    if (fdFileno(ctrl) >= 0 && (rc = fdWritable(ctrl, 0)) < 1) {
1832 -       /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
1833 -    }
1834 -    /*@=branchstate@*/
1835 -
1836 -/*@-usereleased@*/
1837 -    if (fdFileno(ctrl) < 0) {
1838 -       rc = tcpConnect(ctrl, host, port);
1839 -       if (rc < 0)
1840 -           goto errxit2;
1841 -       ctrl = fdLink(ctrl, "open ctrl (httpReq)");
1842 -    }
1843 -
1844 -    len = sizeof("\
1845 -req x HTTP/1.0\r\n\
1846 -User-Agent: rpm/3.0.4\r\n\
1847 -Host: y:z\r\n\
1848 -Accept: text/plain\r\n\
1849 -Transfer-Encoding: chunked\r\n\
1850 -\r\n\
1851 -") + strlen(httpCmd) + strlen(path) + sizeof(VERSION) + strlen(host) + 20;
1852 -
1853 -/*@-boundswrite@*/
1854 -    req = alloca(len);
1855 -    *req = '\0';
1856 -
1857 -  if (!strcmp(httpCmd, "PUT")) {
1858 -    sprintf(req, "\
1859 -%s %s HTTP/1.%d\r\n\
1860 -User-Agent: rpm/%s\r\n\
1861 -Host: %s:%d\r\n\
1862 -Accept: text/plain\r\n\
1863 -Transfer-Encoding: chunked\r\n\
1864 -\r\n\
1865 -",     httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, host, port);
1866 -} else {
1867 -    sprintf(req, "\
1868 -%s %s HTTP/1.%d\r\n\
1869 -User-Agent: rpm/%s\r\n\
1870 -Host: %s:%d\r\n\
1871 -Accept: text/plain\r\n\
1872 -\r\n\
1873 -",     httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, host, port);
1874 -}
1875 -/*@=boundswrite@*/
1876 -
1877 -if (_ftp_debug)
1878 -fprintf(stderr, "-> %s", req);
1879 -
1880 -    len = strlen(req);
1881 -    if (fdWrite(ctrl, req, len) != len) {
1882 -       rc = FTPERR_SERVER_IO_ERROR;
1883 -       goto errxit;
1884 -    }
1885 -
1886 -    /*@-branchstate@*/
1887 -    if (!strcmp(httpCmd, "PUT")) {
1888 -       ctrl->wr_chunked = 1;
1889 -    } else {
1890 -
1891 -       rc = httpResp(u, ctrl, NULL);
1892 -
1893 -       if (rc) {
1894 -           if (!retrying) {    /* not HTTP_OK */
1895 -               retrying = 1;
1896 -               /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
1897 -               goto reopen;
1898 -           }
1899 -           goto errxit;
1900 -       }
1901 -    }
1902 -    /*@=branchstate@*/
1903 -
1904 -    ctrl = fdLink(ctrl, "open data (httpReq)");
1905 -    return 0;
1906 -
1907 -errxit:
1908 -    /*@-observertrans@*/
1909 -    fdSetSyserrno(ctrl, errno, ftpStrerror(rc));
1910 -    /*@=observertrans@*/
1911 -errxit2:
1912 -    /*@-branchstate@*/
1913 -    if (fdFileno(ctrl) >= 0)
1914 -       /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
1915 -    /*@=branchstate@*/
1916 -    return rc;
1917 -/*@=usereleased@*/
1918 -}
1919 -#endif
1920 -
1921  /* XXX DYING: unused */
1922  void * ufdGetUrlinfo(FD_t fd)
1923  {
1924 @@ -2071,29 +1899,6 @@
1925             fd->wr_chunked = 0;
1926         }
1927         break;
1928 -    case URL_IS_HTTPS:
1929 -    case URL_IS_HTTP:
1930 -    case URL_IS_HKP:
1931 -       fd = davOpen(url, flags, mode, &u);
1932 -       if (fd == NULL || u == NULL)
1933 -           break;
1934 -
1935 -       cmd = ((flags & O_WRONLY)
1936 -               ?  ((flags & O_APPEND) ? "PUT" :
1937 -                  ((flags & O_CREAT) ? "PUT" : "PUT"))
1938 -               : "GET");
1939 -       u->openError = davReq(fd, cmd, path);
1940 -       if (u->openError < 0) {
1941 -           /* XXX make sure that we can exit through ufdClose */
1942 -           fd = fdLink(fd, "error ctrl (ufdOpen HTTP)");
1943 -           fd = fdLink(fd, "error data (ufdOpen HTTP)");
1944 -       } else {
1945 -           fd->bytesRemain = ((!strcmp(cmd, "GET"))
1946 -               ?  fd->contentLength : -1);
1947 -           fd->wr_chunked = ((!strcmp(cmd, "PUT"))
1948 -               ?  fd->wr_chunked : 0);
1949 -       }
1950 -       break;
1951      case URL_IS_DASH:
1952         assert(!(flags & O_RDWR));
1953         fd = fdDup( ((flags & O_WRONLY) ? STDOUT_FILENO : STDIN_FILENO) );
1954 @@ -2711,10 +2516,8 @@
1955             if (fd->nfps > 0 && fpno == -1 &&
1956                 fd->fps[fd->nfps-1].io == ufdio &&
1957                 fd->fps[fd->nfps-1].fp == fp &&
1958 -               (fd->fps[fd->nfps-1].fdno >= 0 || fd->req != NULL))
1959 +               (fd->fps[fd->nfps-1].fdno >= 0))
1960             {
1961 -               int hadreqpersist = (fd->req != NULL);
1962 -
1963                 if (fp)
1964                     rc = fflush(fp);
1965                 fd->nfps--;
1966 @@ -2724,26 +2527,9 @@
1967  /*@-usereleased@*/
1968                 if (fdGetFdno(fd) >= 0)
1969                     break;
1970 -               if (!fd->persist)
1971 -                   hadreqpersist = 0;
1972                 fdSetFp(fd, NULL);
1973                 fd->nfps++;
1974                 if (fp) {
1975 -                   /* HACK: flimsy Keepalive wiring. */
1976 -                   if (hadreqpersist) {
1977 -                       fd->nfps--;
1978 -/*@-exposetrans@*/
1979 -                       fdSetFp(fd, fp);
1980 -/*@=exposetrans@*/
1981 -/*@-refcounttrans@*/
1982 -                       (void) fdClose(fd);
1983 -/*@=refcounttrans@*/
1984 -                       fdSetFp(fd, NULL);
1985 -                       fd->nfps++;
1986 -/*@-refcounttrans@*/
1987 -                       (void) fdClose(fd);
1988 -/*@=refcounttrans@*/
1989 -                   } else
1990                         rc = fclose(fp);
1991                 }
1992                 fdPop(fd);
1993 @@ -2992,18 +2778,10 @@
1994             return NULL;
1995         }
1996      } else {
1997 -       FILE *fp;
1998 -       int fdno;
1999 -       int isHTTP = 0;
2000  
2001         /* XXX gzdio and bzdio here too */
2002  
2003         switch (urlIsURL(path)) {
2004 -       case URL_IS_HTTPS:
2005 -       case URL_IS_HTTP:
2006 -       case URL_IS_HKP:
2007 -           isHTTP = 1;
2008 -           /*@fallthrough@*/
2009         case URL_IS_PATH:
2010         case URL_IS_DASH:
2011         case URL_IS_FTP:
2012 @@ -3011,7 +2789,7 @@
2013  if (_rpmio_debug)
2014  fprintf(stderr, "*** Fopen ufdio path %s fmode %s\n", path, fmode);
2015             fd = ufdOpen(path, flags, perms);
2016 -           if (fd == NULL || !(fdFileno(fd) >= 0 || fd->req != NULL))
2017 +           if (fd == NULL || !(fdFileno(fd) >= 0))
2018                 return fd;
2019             break;
2020         default:
2021 @@ -3020,15 +2798,6 @@
2022             return NULL;
2023             /*@notreached@*/ break;
2024         }
2025 -
2026 -       /* XXX persistent HTTP/1.1 returns the previously opened fp */
2027 -       if (isHTTP && ((fp = fdGetFp(fd)) != NULL) && ((fdno = fdGetFdno(fd)) >= 0 || fd->req != NULL))
2028 -       {
2029 -           /*@+voidabstract@*/
2030 -           fdPush(fd, fpio, fp, fileno(fp));   /* Push fpio onto stack */
2031 -           /*@=voidabstract@*/
2032 -           return fd;
2033 -       }
2034      }
2035      /*@=branchstate@*/
2036  
2037 @@ -3064,10 +2833,6 @@
2038      int i, rc = 0;
2039  
2040      if (fd == NULL) return -1;
2041 -    if (fd->req != NULL) {
2042 -       /* HACK: flimsy wiring for neon errors. */
2043 -       rc = (fd->syserrno  || fd->errcookie != NULL) ? -1 : 0;
2044 -    } else
2045      for (i = fd->nfps; rc == 0 && i >= 0; i--) {
2046  /*@-boundsread@*/
2047         FDSTACK_t * fps = &fd->fps[i];
2048 @@ -3102,9 +2867,6 @@
2049  {
2050      int i, rc = -1;
2051  
2052 -    if (fd->req != NULL)
2053 -       rc = 123456789; /* HACK: https has no steenkin fileno. */
2054 -    else
2055      for (i = fd->nfps ; rc == -1 && i >= 0; i--) {
2056  /*@-boundsread@*/
2057         rc = fd->fps[i].fdno;
2058 diff -ur rpm-4.4.1/rpmio/rpmio_internal.h rpm-4.4.1-no-neon/rpmio/rpmio_internal.h
2059 --- rpm-4.4.1/rpmio/rpmio_internal.h    2005-02-08 18:14:20.000000000 +0100
2060 +++ rpm-4.4.1-no-neon/rpmio/rpmio_internal.h    2005-06-19 20:34:07.006758008 +0200
2061 @@ -152,7 +152,6 @@
2062  /*@dependent@*/
2063      void *     url;            /* ufdio: URL info */
2064  /*@relnull@*/
2065 -    void *     req;            /* ufdio: HTTP request */
2066  
2067      int                rd_timeoutsecs; /* ufdRead: per FD_t timer */
2068      ssize_t    bytesRemain;    /* ufdio: */
2069 diff -ur rpm-4.4.1/rpmio/rpmrpc.c rpm-4.4.1-no-neon/rpmio/rpmrpc.c
2070 --- rpm-4.4.1/rpmio/rpmrpc.c    2005-01-26 06:16:09.000000000 +0100
2071 +++ rpm-4.4.1-no-neon/rpmio/rpmrpc.c    2005-06-19 20:34:07.008757704 +0200
2072 @@ -91,10 +91,6 @@
2073      case URL_IS_FTP:
2074         return ftpMkdir(path, mode);
2075         /*@notreached@*/ break;
2076 -    case URL_IS_HTTPS:
2077 -    case URL_IS_HTTP:
2078 -       return davMkdir(path, mode);
2079 -       /*@notreached@*/ break;
2080      case URL_IS_PATH:
2081         path = lpath;
2082         /*@fallthrough@*/
2083 @@ -118,14 +114,6 @@
2084      case URL_IS_FTP:
2085         return ftpChdir(path);
2086         /*@notreached@*/ break;
2087 -    case URL_IS_HTTPS:
2088 -    case URL_IS_HTTP:
2089 -#ifdef NOTYET
2090 -       return davChdir(path);
2091 -#else
2092 -       return -2;
2093 -#endif
2094 -       /*@notreached@*/ break;
2095      case URL_IS_PATH:
2096         path = lpath;
2097         /*@fallthrough@*/
2098 @@ -149,10 +137,6 @@
2099      case URL_IS_FTP:
2100         return ftpRmdir(path);
2101         /*@notreached@*/ break;
2102 -    case URL_IS_HTTPS:
2103 -    case URL_IS_HTTP:
2104 -       return davRmdir(path);
2105 -       /*@notreached@*/ break;
2106      case URL_IS_PATH:
2107         path = lpath;
2108         /*@fallthrough@*/
2109 @@ -180,10 +164,6 @@
2110  
2111      oldut = urlPath(oldpath, &oe);
2112      switch (oldut) {
2113 -    case URL_IS_HTTPS:
2114 -    case URL_IS_HTTP:
2115 -       return davRename(oldpath, newpath);
2116 -       /*@notreached@*/ break;
2117      case URL_IS_FTP:           /* XXX WRONG WRONG WRONG */
2118      case URL_IS_PATH:
2119      case URL_IS_UNKNOWN:
2120 @@ -278,10 +258,6 @@
2121      case URL_IS_FTP:
2122         return ftpUnlink(path);
2123         /*@notreached@*/ break;
2124 -    case URL_IS_HTTPS:
2125 -    case URL_IS_HTTP:
2126 -       return davUnlink(path);
2127 -       /*@notreached@*/ break;
2128      case URL_IS_PATH:
2129         path = lpath;
2130         /*@fallthrough@*/
2131 @@ -1280,10 +1256,6 @@
2132      case URL_IS_FTP:
2133         return ftpStat(path, st);
2134         /*@notreached@*/ break;
2135 -    case URL_IS_HTTPS:
2136 -    case URL_IS_HTTP:
2137 -       return davStat(path, st);
2138 -       /*@notreached@*/ break;
2139      case URL_IS_PATH:
2140         path = lpath;
2141         /*@fallthrough@*/
2142 @@ -1309,10 +1281,6 @@
2143      case URL_IS_FTP:
2144         return ftpLstat(path, st);
2145         /*@notreached@*/ break;
2146 -    case URL_IS_HTTPS:
2147 -    case URL_IS_HTTP:
2148 -       return davLstat(path, st);
2149 -       /*@notreached@*/ break;
2150      case URL_IS_PATH:
2151         path = lpath;
2152         /*@fallthrough@*/
2153 @@ -1336,14 +1304,6 @@
2154      case URL_IS_FTP:
2155         return ftpReadlink(path, buf, bufsiz);
2156         /*@notreached@*/ break;
2157 -    case URL_IS_HTTPS:
2158 -    case URL_IS_HTTP:
2159 -#ifdef NOTYET
2160 -       return davReadlink(path, buf, bufsiz);
2161 -#else
2162 -       return -2;
2163 -#endif
2164 -       /*@notreached@*/ break;
2165      case URL_IS_PATH:
2166         path = lpath;
2167         /*@fallthrough@*/
2168 @@ -1487,10 +1447,6 @@
2169      case URL_IS_FTP:
2170         return ftpOpendir(path);
2171         /*@notreached@*/ break;
2172 -    case URL_IS_HTTPS: 
2173 -    case URL_IS_HTTP:
2174 -       return davOpendir(path);
2175 -       /*@notreached@*/ break;
2176      case URL_IS_PATH:
2177         path = lpath;
2178         /*@fallthrough@*/
2179 @@ -1515,8 +1471,6 @@
2180         return NULL;
2181      if (ISAVMAGIC(dir))
2182         return avReaddir(dir);
2183 -    if (ISDAVMAGIC(dir))
2184 -       return davReaddir(dir);
2185      return readdir(dir);
2186  }
2187  
2188 @@ -1528,7 +1482,5 @@
2189         return 0;
2190      if (ISAVMAGIC(dir))
2191         return avClosedir(dir);
2192 -    if (ISDAVMAGIC(dir))
2193 -       return davClosedir(dir);
2194      return closedir(dir);
2195  }
2196 diff -ur rpm-4.4.1/rpmio/tget.c rpm-4.4.1-no-neon/rpmio/tget.c
2197 --- rpm-4.4.1/rpmio/tget.c      2004-11-19 17:52:58.000000000 +0100
2198 +++ rpm-4.4.1-no-neon/rpmio/tget.c      2005-06-19 20:34:07.009757552 +0200
2199 @@ -9,7 +9,6 @@
2200  
2201  static int _debug = 0;
2202  
2203 -int noNeon;
2204  
2205  #define        HTTPSPATH       "https://localhost/test.txt"
2206  #define        HTTPPATH        "http://localhost/test.txt"
2207 @@ -40,8 +39,6 @@
2208   { "debug", 'd', POPT_ARG_VAL, &_debug, -1,            NULL, NULL },
2209   { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2210         N_("debug protocol data stream"), NULL},
2211 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2212 -       N_("disable use of libneon for HTTP"), NULL},
2213   { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2214         N_("debug rpmio I/O"), NULL},
2215   { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2216 diff -ur rpm-4.4.1/rpmio/tglob.c rpm-4.4.1-no-neon/rpmio/tglob.c
2217 --- rpm-4.4.1/rpmio/tglob.c     2004-11-19 17:53:05.000000000 +0100
2218 +++ rpm-4.4.1-no-neon/rpmio/tglob.c     2005-06-19 20:34:07.010757400 +0200
2219 @@ -9,7 +9,6 @@
2220  
2221  static int _debug = 0;
2222  
2223 -int noNeon;
2224  
2225  #define        HTTPSPATH       "https://localhost/rawhide/test/*.rpm"
2226  #if 0
2227 @@ -52,8 +51,6 @@
2228   { "debug", 'd', POPT_ARG_VAL, &_debug, -1,            NULL, NULL },
2229   { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2230         N_("debug protocol data stream"), NULL},
2231 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2232 -       N_("disable use of libneon for HTTP"), NULL},
2233   { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2234         N_("debug rpmio I/O"), NULL},
2235   { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2236 diff -ur rpm-4.4.1/rpmio/thkp.c rpm-4.4.1-no-neon/rpmio/thkp.c
2237 --- rpm-4.4.1/rpmio/thkp.c      2005-01-04 17:35:12.000000000 +0100
2238 +++ rpm-4.4.1-no-neon/rpmio/thkp.c      2005-06-19 20:34:07.012757096 +0200
2239 @@ -10,7 +10,6 @@
2240  static int _debug = 0;
2241  static int _printing = 0;
2242  
2243 -int noNeon;
2244  
2245  #if 0
2246  #define        HKPPATH         "hkp://pgp.mit.edu:11371/pks/lookup?op=get&search=0xF5C75256"
2247 @@ -95,8 +94,6 @@
2248         N_("debug protocol data stream"), NULL},
2249   { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2250         N_("debug protocol data stream"), NULL},
2251 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2252 -       N_("disable use of libneon for HTTP"), NULL},
2253   { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2254         N_("debug rpmio I/O"), NULL},
2255   { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2256 diff -ur rpm-4.4.1/rpmio/tput.c rpm-4.4.1-no-neon/rpmio/tput.c
2257 --- rpm-4.4.1/rpmio/tput.c      2004-11-19 17:53:11.000000000 +0100
2258 +++ rpm-4.4.1-no-neon/rpmio/tput.c      2005-06-19 20:34:07.013756944 +0200
2259 @@ -9,7 +9,6 @@
2260  
2261  static int _debug = 0;
2262  
2263 -int noNeon;
2264  
2265  #define        HTTPSPATH       "https://localhost/rawhide/toad/tput.txt"
2266  #define        HTTPPATH        "http://localhost/rawhide/toad/tput.txt"
2267 @@ -100,8 +99,6 @@
2268   { "debug", 'd', POPT_ARG_VAL, &_debug, -1,            NULL, NULL },
2269   { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2270         N_("debug protocol data stream"), NULL},
2271 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2272 -       N_("disable use of libneon for HTTP"), NULL},
2273   { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2274         N_("debug rpmio I/O"), NULL},
2275   { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2276 diff -ur rpm-4.4.1/rpmio/tring.c rpm-4.4.1-no-neon/rpmio/tring.c
2277 --- rpm-4.4.1/rpmio/tring.c     2004-11-28 21:41:04.000000000 +0100
2278 +++ rpm-4.4.1-no-neon/rpmio/tring.c     2005-06-19 20:34:07.013756944 +0200
2279 @@ -5,7 +5,6 @@
2280  
2281  static int printing = 1;
2282  static int _debug = 0;
2283 -int noNeon;
2284  
2285  static struct poptOption optionsTable[] = {
2286   { "print", 'p', POPT_ARG_VAL, &printing, 1,           NULL, NULL },
2287 @@ -13,8 +12,6 @@
2288   { "debug", 'd', POPT_ARG_VAL, &_debug, -1,            NULL, NULL },
2289   { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2290         N_("debug protocol data stream"), NULL},
2291 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2292 -       N_("disable use of libneon for HTTP"), NULL},
2293   { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2294         N_("debug rpmio I/O"), NULL},
2295   { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2296 diff -ur rpm-4.4.1/rpmio/url.c rpm-4.4.1-no-neon/rpmio/url.c
2297 --- rpm-4.4.1/rpmio/url.c       2004-11-28 21:41:31.000000000 +0100
2298 +++ rpm-4.4.1-no-neon/rpmio/url.c       2005-06-19 20:37:11.810663544 +0200
2299 @@ -148,7 +148,6 @@
2300      }
2301      if (u->sess != NULL) {
2302         /* HACK: neon include has prototype. */
2303 -       ne_session_destroy(u->sess);
2304         u->sess = NULL;
2305      }
2306      u->buf = _free(u->buf);
2307 @@ -352,9 +351,6 @@
2308  } urlstrings[] = {
2309      { "file://",       URL_IS_PATH },
2310      { "ftp://",                URL_IS_FTP },
2311 -    { "hkp://",                URL_IS_HKP },
2312 -    { "http://",       URL_IS_HTTP },
2313 -    { "https://",      URL_IS_HTTPS },
2314      { "-",             URL_IS_DASH },
2315      { NULL,            URL_IS_UNKNOWN }
2316  };
This page took 0.324811 seconds and 4 git commands to generate.