1 diff -ur rpm-4.4.7.org/configure.ac rpm-4.4.7/configure.ac
2 --- rpm-4.4.7.org/configure.ac 2006-10-17 22:12:03.110624000 +0200
3 +++ rpm-4.4.7/configure.ac 2006-10-17 22:12:43.117124500 +0200
5 AC_SUBST(WITH_BEECRYPT_INCLUDE)
6 AC_SUBST(WITH_BEECRYPT_LIB)
9 -# Check for neon library. Prefer external, otherwise internal.
13 -AC_CHECK_HEADER([neon/ne_session.h], [
14 - AC_CHECK_LIB(neon, ne_session_create, [
15 - AC_DEFINE(HAVE_LIBNEON, 1, [Define to 1 if you have the 'neon' library (-lneon).])
16 - AC_CHECK_LIB(neon, ne_get_response_header, [
17 - AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, [Define to 1 if you have ne_get_response_header() in libneon.])
19 - AC_CHECK_LIB(neon, ne_send_request_chunk, [
20 - AC_DEFINE(HAVE_NEON_NE_SEND_REQUEST_CHUNK, 1, [Define to 1 if you have ne_send_request_chunk() in libneon.])
22 - WITH_NEON_INCLUDE="-I${includedir}/neon"
23 - WITH_NEON_LIB="-lneon"
26 - if test -d neon ; then
27 - AC_DEFINE(HAVE_LIBNEON, 1, [Define to 1 if you have the 'neon' library (-lneon).])
28 -# XXX HAVE_NEON_NE_GET_RESPONSE_HEADER assumes libneon-0.25 devel internal
29 - AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, [Define to 1 if you have ne_get_response_header() in libneon.])
30 - WITH_NEON_SUBDIR=neon
31 - WITH_NEON_INCLUDE="-I\${top_srcdir}/${WITH_NEON_SUBDIR}/src"
32 - WITH_NEON_LIB="\${top_builddir}/${WITH_NEON_SUBDIR}/src/libneon.la"
35 AC_SUBST(WITH_NEON_SUBDIR)
36 AC_SUBST(WITH_NEON_INCLUDE)
37 AC_SUBST(WITH_NEON_LIB)
38 diff -ur rpm-4.4.7.org/rpmio/rpmdav.c rpm-4.4.7/rpmio/rpmdav.c
39 --- rpm-4.4.7.org/rpmio/rpmdav.c 2006-04-17 17:23:29.000000000 +0200
40 +++ rpm-4.4.7/rpmio/rpmdav.c 2006-10-17 22:14:01.150001250 +0200
45 -#include "ne_alloc.h"
47 -#include "ne_basic.h"
48 -#include "ne_dates.h"
49 -#include "ne_locks.h"
51 -#define NEONBLOWSCHUNKS
52 -#ifndef NEONBLOWSCHUNKS
53 -/* HACK: include ne_private.h to access sess->socket for now. */
54 -#include "../neon/src/ne_private.h"
57 -#include "ne_props.h"
58 -#include "ne_request.h"
59 -#include "ne_socket.h"
60 -#include "ne_string.h"
61 -#include "ne_utils.h"
63 -/* XXX API changes for neon-0.26.0 */
64 -#if !defined(NE_FREE)
65 -#define ne_set_persist(_sess, _flag)
66 -#define ne_propfind_set_private(_pfh, _create_item, NULL) \
67 - ne_propfind_set_private(_pfh, _create_item, NULL, NULL)
70 #include <rpmio_internal.h>
72 #define _RPMDAV_INTERNAL
76 /* =============================================================== */
77 -static int davFree(urlinfo u)
78 - /*@globals internalState @*/
79 - /*@modifies u, internalState @*/
81 - if (u != NULL && u->sess != NULL) {
82 - u->capabilities = _free(u->capabilities);
83 - if (u->lockstore != NULL)
84 - ne_lockstore_destroy(u->lockstore);
85 - u->lockstore = NULL;
86 - ne_session_destroy(u->sess);
92 -static void davProgress(void * userdata, off_t current, off_t total)
95 - urlinfo u = userdata;
100 -assert(sess != NULL);
101 -assert(u == ne_get_session_private(sess, "urlinfo"));
103 - u->current = current;
107 -fprintf(stderr, "*** davProgress(%p,0x%x:0x%x) sess %p u %p\n", userdata, (unsigned int)current, (unsigned int)total, sess, u);
110 -static void davNotify(void * userdata,
111 - ne_conn_status connstatus, const char * info)
114 - urlinfo u = userdata;
117 - static const char * connstates[] = {
127 -assert(sess != NULL);
128 -assert(u == ne_get_session_private(sess, "urlinfo"));
132 - ne_conn_namelookup, /* lookup up hostname (info = hostname) */
133 - ne_conn_connecting, /* connecting to host (info = hostname) */
134 - ne_conn_connected, /* connected to host (info = hostname) */
135 - ne_conn_secure /* connection now secure (info = crypto level) */
139 - u->connstatus = connstatus;
143 -fprintf(stderr, "*** davNotify(%p,%d,%p) sess %p u %p %s\n", userdata, connstatus, info, sess, u, connstates[ (connstatus < 4 ? connstatus : 4)]);
148 -static void davCreateRequest(ne_request * req, void * userdata,
149 - const char * method, const char * uri)
152 - urlinfo u = userdata;
154 - void * private = NULL;
155 - const char * id = "urlinfo";
158 -assert(u->sess != NULL);
159 -assert(req != NULL);
160 - sess = ne_get_session(req);
161 -assert(sess == u->sess);
162 -assert(u == ne_get_session_private(sess, "urlinfo"));
164 -assert(sess != NULL);
165 - private = ne_get_session_private(sess, id);
166 -assert(u == private);
169 -fprintf(stderr, "*** davCreateRequest(%p,%p,%s,%s) %s:%p\n", req, userdata, method, uri, id, private);
172 -static void davPreSend(ne_request * req, void * userdata, ne_buffer * buf)
174 - urlinfo u = userdata;
176 - const char * id = "fd";
180 -assert(u->sess != NULL);
181 -assert(req != NULL);
182 - sess = ne_get_session(req);
183 -assert(sess == u->sess);
184 -assert(u == ne_get_session_private(sess, "urlinfo"));
186 - fd = ne_get_request_private(req, id);
189 -fprintf(stderr, "*** davPreSend(%p,%p,%p) sess %p %s %p\n", req, userdata, buf, sess, id, fd);
191 -fprintf(stderr, "-> %s\n", buf->data);
195 -static int davPostSend(ne_request * req, void * userdata, const ne_status * status)
198 - urlinfo u = userdata;
200 - const char * id = "fd";
204 -assert(u->sess != NULL);
205 -assert(req != NULL);
206 - sess = ne_get_session(req);
207 -assert(sess == u->sess);
208 -assert(u == ne_get_session_private(sess, "urlinfo"));
210 - fd = ne_get_request_private(req, id);
214 -fprintf(stderr, "*** davPostSend(%p,%p,%p) sess %p %s %p %s\n", req, userdata, status, sess, id, fd, ne_get_error(sess));
219 -static void davDestroyRequest(ne_request * req, void * userdata)
222 - urlinfo u = userdata;
224 - const char * id = "fd";
228 -assert(u->sess != NULL);
229 -assert(req != NULL);
230 - sess = ne_get_session(req);
231 -assert(sess == u->sess);
232 -assert(u == ne_get_session_private(sess, "urlinfo"));
234 - fd = ne_get_request_private(req, id);
237 -fprintf(stderr, "*** davDestroyRequest(%p,%p) sess %p %s %p\n", req, userdata, sess, id, fd);
240 -static void davDestroySession(void * userdata)
243 - urlinfo u = userdata;
245 - void * private = NULL;
246 - const char * id = "urlinfo";
249 -assert(u->sess != NULL);
251 -assert(u == ne_get_session_private(sess, "urlinfo"));
253 -assert(sess != NULL);
254 - private = ne_get_session_private(sess, id);
255 -assert(u == private);
258 -fprintf(stderr, "*** davDestroySession(%p) sess %p %s %p\n", userdata, sess, id, private);
262 -davVerifyCert(void *userdata, int failures, const ne_ssl_certificate *cert)
265 - const char *hostname = userdata;
268 -fprintf(stderr, "*** davVerifyCert(%p,%d,%p) %s\n", userdata, failures, cert, hostname);
270 - return 0; /* HACK: trust all server certificates. */
273 -static int davConnect(urlinfo u)
274 - /*@globals internalState @*/
275 - /*@modifies u, internalState @*/
277 - const char * path = NULL;
280 - /* HACK: hkp:// has no steenkin' options */
281 - if (!(u->urltype == URL_IS_HTTP || u->urltype == URL_IS_HTTPS))
284 - /* HACK: where should server capabilities be read? */
285 - (void) urlPath(u->url, &path);
286 - /* HACK: perhaps capture Allow: tag, look for PUT permitted. */
287 - rc = ne_options(u->sess, path, u->capabilities);
292 - /* HACK: "301 Moved Permanently" on empty subdir. */
293 - if (!strncmp("301 ", ne_get_error(u->sess), sizeof("301 ")-1))
300 -fprintf(stderr, "*** Connect to %s:%d failed(%d):\n\t%s\n",
301 - u->host, u->port, rc, ne_get_error(u->sess));
305 - /* HACK: sensitive to error returns? */
306 - u->httpVersion = (ne_version_pre_http11(u->sess) ? 0 : 1);
311 -static int davInit(const char * url, urlinfo * uret)
312 - /*@globals internalState @*/
313 - /*@modifies *uret, internalState @*/
318 -/*@-globs@*/ /* FIX: h_errno annoyance. */
319 - if (urlSplit(url, &u))
320 - return -1; /* XXX error returns needed. */
323 - if (u->url != NULL && u->sess == NULL)
324 - switch (u->urltype) {
326 - assert(u->urltype != u->urltype);
327 - /*@notreached@*/ break;
331 - { ne_server_capabilities * capabilities;
333 - /* HACK: oneshots should be done Somewhere Else Instead. */
335 - rc = ((_dav_debug < 0) ? NE_DBG_HTTP : 0);
336 - ne_debug_init(stderr, rc); /* XXX oneshot? */
338 - rc = ne_sock_init(); /* XXX oneshot? */
340 - u->lockstore = ne_lockstore_create(); /* XXX oneshot? */
342 - u->capabilities = capabilities = xcalloc(1, sizeof(*capabilities));
343 - u->sess = ne_session_create(u->scheme, u->host, u->port);
345 - ne_lockstore_register(u->lockstore, u->sess);
347 - if (u->proxyh != NULL)
348 - ne_session_proxy(u->sess, u->proxyh, u->proxyp);
351 - { const ne_inet_addr ** addrs;
353 - ne_set_addrlist(u->sess, addrs, n);
357 - ne_set_progress(u->sess, davProgress, u);
358 - ne_set_status(u->sess, davNotify, u);
360 - ne_set_persist(u->sess, 1);
361 - ne_set_read_timeout(u->sess, httpTimeoutSecs);
362 - ne_set_useragent(u->sess, PACKAGE "/" PACKAGE_VERSION);
364 - /* XXX check that neon is ssl enabled. */
365 - if (!strcasecmp(u->scheme, "https"))
366 - ne_ssl_set_verify(u->sess, davVerifyCert, (char *)u->host);
368 - ne_set_session_private(u->sess, "urlinfo", u);
370 - ne_hook_destroy_session(u->sess, davDestroySession, u);
372 - ne_hook_create_request(u->sess, davCreateRequest, u);
373 - ne_hook_pre_send(u->sess, davPreSend, u);
374 - ne_hook_post_send(u->sess, davPostSend, u);
375 - ne_hook_destroy_request(u->sess, davDestroyRequest, u);
377 - /* HACK: where should server capabilities be read? */
378 - rc = davConnect(u);
386 - if (rc == 0 && uret != NULL)
387 - *uret = urlLink(u, __FUNCTION__);
389 - u = urlFree(u, "urlSplit (davInit)");
394 -/* =============================================================== */
395 -enum fetch_rtype_e {
402 -struct fetch_resource_s {
404 - struct fetch_resource_s *next;
408 - enum fetch_rtype_e type;
412 - int is_vcr; /* Is version resource. 0: no vcr, 1 checkin 2 checkout */
413 - char *error_reason; /* error string returned for this resource */
414 - int error_status; /* error status returned for this resource */
418 -static void *fetch_destroy_item(/*@only@*/ struct fetch_resource_s *res)
419 - /*@modifies res @*/
422 - ne_free(res->error_reason);
429 -static void *fetch_destroy_list(/*@only@*/ struct fetch_resource_s *res)
430 - /*@modifies res @*/
432 - struct fetch_resource_s *next;
434 - for (; res != NULL; res = next) {
436 - res = fetch_destroy_item(res);
443 -static void *fetch_create_item(/*@unused@*/ void *userdata, /*@unused@*/ const char *uri)
446 - struct fetch_resource_s * res = ne_calloc(sizeof(*res));
450 -/* =============================================================== */
451 -struct fetch_context_s {
452 -/*@relnull@*/ /*@dependent@*/
453 - struct fetch_resource_s **resrock;
455 - unsigned int include_target; /* Include resource at href */
467 -static void *fetch_destroy_context(/*@only@*/ /*@null@*/ struct fetch_context_s *ctx)
468 - /*@globals internalState @*/
469 - /*@modifies ctx, internalState @*/
473 - if (ctx->av != NULL)
474 - ctx->av = argvFree(ctx->av);
475 - ctx->modes = _free(ctx->modes);
476 - ctx->sizes = _free(ctx->sizes);
477 - ctx->mtimes = _free(ctx->mtimes);
478 - ctx->u = urlFree(ctx->u, __FUNCTION__);
479 - ctx->uri = _free(ctx->uri);
481 - memset(ctx, 0, sizeof(*ctx));
488 -static void *fetch_create_context(const char *uri)
489 - /*@globals internalState @*/
490 - /*@modifies internalState @*/
492 - struct fetch_context_s * ctx;
495 -/*@-globs@*/ /* FIX: h_errno annoyance. */
496 - if (urlSplit(uri, &u))
500 - ctx = ne_calloc(sizeof(*ctx));
501 - ctx->uri = xstrdup(uri);
502 - ctx->u = urlLink(u, __FUNCTION__);
506 -/*@unchecked@*/ /*@observer@*/
507 -static const ne_propname fetch_props[] = {
508 - { "DAV:", "getcontentlength" },
509 - { "DAV:", "getlastmodified" },
510 - { "http://apache.org/dav/props/", "executable" },
511 - { "DAV:", "resourcetype" },
512 - { "DAV:", "checked-in" },
513 - { "DAV:", "checked-out" },
517 -#define ELM_resourcetype (NE_PROPS_STATE_TOP + 1)
518 -#define ELM_collection (NE_PROPS_STATE_TOP + 2)
520 -/*@unchecked@*/ /*@observer@*/
521 -static const struct ne_xml_idmap fetch_idmap[] = {
522 - { "DAV:", "resourcetype", ELM_resourcetype },
523 - { "DAV:", "collection", ELM_collection }
526 -static int fetch_startelm(void *userdata, int parent,
527 - const char *nspace, const char *name,
528 - /*@unused@*/ const char **atts)
531 - ne_propfind_handler *pfh = userdata;
532 - struct fetch_resource_s *r = ne_propfind_current_private(pfh);
533 - int state = ne_xml_mapid(fetch_idmap, NE_XML_MAPLEN(fetch_idmap),
537 - !((parent == NE_207_STATE_PROP && state == ELM_resourcetype) ||
538 - (parent == ELM_resourcetype && state == ELM_collection)))
539 - return NE_XML_DECLINE;
541 - if (state == ELM_collection) {
542 - r->type = resr_collection;
548 -static int fetch_compare(const struct fetch_resource_s *r1,
549 - const struct fetch_resource_s *r2)
552 - /* Sort errors first, then collections, then alphabetically */
553 - if (r1->type == resr_error) {
555 - } else if (r2->type == resr_error) {
557 - } else if (r1->type == resr_collection) {
558 - if (r2->type != resr_collection) {
561 - return strcmp(r1->uri, r2->uri);
564 - if (r2->type != resr_collection) {
565 - return strcmp(r1->uri, r2->uri);
572 -static void fetch_results(void *userdata, void *uarg,
573 - const ne_prop_result_set *set)
576 - struct fetch_context_s *ctx = userdata;
577 - struct fetch_resource_s *current, *previous, *newres;
578 - const char *clength, *modtime, *isexec;
579 - const char *checkin, *checkout;
580 - const ne_status *status = NULL;
581 - const char * path = NULL;
583 -#if !defined(NE_FREE)
584 - const ne_uri * uri = uarg;
585 - (void) urlPath(uri->path, &path);
587 - const char * uri = uarg;
588 - (void) urlPath(uri, &path);
593 - newres = ne_propset_private(set);
596 -fprintf(stderr, "==> %s in uri %s\n", path, ctx->uri);
598 - if (ne_path_compare(ctx->uri, path) == 0 && !ctx->include_target) {
599 - /* This is the target URI */
601 -fprintf(stderr, "==> %s skipping target resource.\n", path);
602 - /* Free the private structure. */
603 -/*@-dependenttrans -exposetrans@*/
605 -/*@=dependenttrans =exposetrans@*/
609 - newres->uri = ne_strdup(path);
612 - clength = ne_propset_value(set, &fetch_props[0]);
613 - modtime = ne_propset_value(set, &fetch_props[1]);
614 - isexec = ne_propset_value(set, &fetch_props[2]);
615 - checkin = ne_propset_value(set, &fetch_props[4]);
616 - checkout = ne_propset_value(set, &fetch_props[5]);
620 - if (clength == NULL)
621 - status = ne_propset_status(set, &fetch_props[0]);
622 - if (modtime == NULL)
623 - status = ne_propset_status(set, &fetch_props[1]);
626 - if (newres->type == resr_normal && status != NULL) {
627 - /* It's an error! */
628 - newres->error_status = status->code;
630 - /* Special hack for Apache 1.3/mod_dav */
631 - if (strcmp(status->reason_phrase, "status text goes here") == 0) {
633 - if (status->code == 401) {
634 - desc = _("Authorization Required");
635 - } else if (status->klass == 3) {
636 - desc = _("Redirect");
637 - } else if (status->klass == 5) {
638 - desc = _("Server Error");
640 - desc = _("Unknown Error");
642 - newres->error_reason = ne_strdup(desc);
644 - newres->error_reason = ne_strdup(status->reason_phrase);
646 - newres->type = resr_error;
649 - if (isexec && strcasecmp(isexec, "T") == 0) {
650 - newres->is_executable = 1;
652 - newres->is_executable = 0;
656 - newres->modtime = ne_httpdate_parse(modtime);
659 - newres->size = atoi(clength);
663 - newres->is_vcr = 1;
664 - } else if (checkout) {
665 - newres->is_vcr = 2;
667 - newres->is_vcr = 0;
670 - for (current = *ctx->resrock, previous = NULL; current != NULL;
671 - previous = current, current = current->next)
673 - if (fetch_compare(current, newres) >= 0) {
678 - previous->next = newres;
680 -/*@-boundswrite -dependenttrans @*/
681 - *ctx->resrock = newres;
682 -/*@=boundswrite =dependenttrans @*/
684 - newres->next = current;
687 -static int davFetch(const urlinfo u, struct fetch_context_s * ctx)
688 - /*@globals internalState @*/
689 - /*@modifies ctx, internalState @*/
691 - const char * path = NULL;
692 - int depth = 1; /* XXX passed arg? */
693 - unsigned int include_target = 0; /* XXX passed arg? */
694 - struct fetch_resource_s * resitem = NULL;
695 - struct fetch_resource_s ** resrock = &resitem; /* XXX passed arg? */
696 - ne_propfind_handler *pfh;
697 - struct fetch_resource_s *current, *next;
702 - (void) urlPath(u->url, &path);
703 - pfh = ne_propfind_create(u->sess, ctx->uri, depth);
705 - /* HACK: need to set u->httpHasRange here. */
707 - ctx->resrock = resrock;
708 - ctx->include_target = include_target;
710 - ne_xml_push_handler(ne_propfind_get_parser(pfh),
711 - fetch_startelm, NULL, NULL, pfh);
713 - ne_propfind_set_private(pfh, fetch_create_item, NULL);
715 - rc = ne_propfind_named(pfh, fetch_props, fetch_results, ctx);
717 - ne_propfind_destroy(pfh);
719 - for (current = resitem; current != NULL; current = next) {
720 - const char *s, *se;
723 - next = current->next;
725 - /* Collections have trailing '/' that needs trim. */
726 - /* The top level collection is returned as well. */
727 - se = current->uri + strlen(current->uri);
728 - if (se[-1] == '/') {
729 - if (strlen(current->uri) <= strlen(path)) {
730 - current = fetch_destroy_item(current);
736 - while (s > current->uri && s[-1] != '/')
739 - val = ne_strndup(s, (se - s));
742 - val = ne_path_unescape(val);
745 - xx = argvAdd(&ctx->av, val);
747 -fprintf(stderr, "*** argvAdd(%p,\"%s\")\n", &ctx->av, val);
750 - while (ctx->ac >= ctx->nalloced) {
751 - if (ctx->nalloced <= 0)
753 - ctx->nalloced *= 2;
754 - ctx->modes = xrealloc(ctx->modes,
755 - (sizeof(*ctx->modes) * ctx->nalloced));
756 - ctx->sizes = xrealloc(ctx->sizes,
757 - (sizeof(*ctx->sizes) * ctx->nalloced));
758 - ctx->mtimes = xrealloc(ctx->mtimes,
759 - (sizeof(*ctx->mtimes) * ctx->nalloced));
762 - switch (current->type) {
765 - /*@switchbreak@*/ break;
766 - case resr_collection:
768 - /*@switchbreak@*/ break;
769 - case resr_reference:
773 - /*@switchbreak@*/ break;
776 - ctx->modes[ctx->ac] = st_mode;
777 - ctx->sizes[ctx->ac] = current->size;
778 - ctx->mtimes[ctx->ac] = current->modtime;
782 - current = fetch_destroy_item(current);
784 - ctx->resrock = NULL; /* HACK: avoid leaving stack reference. */
789 -static int davNLST(struct fetch_context_s * ctx)
790 - /*@globals internalState @*/
791 - /*@modifies ctx, internalState @*/
797 - rc = davInit(ctx->uri, &u);
798 - if (rc || u == NULL)
801 - rc = davFetch(u, ctx);
806 - /* HACK: "301 Moved Permanently" on empty subdir. */
807 - if (!strncmp("301 ", ne_get_error(u->sess), sizeof("301 ")-1))
812 -fprintf(stderr, "*** Fetch from %s:%d failed:\n\t%s\n",
813 - u->host, u->port, ne_get_error(u->sess));
823 -/* =============================================================== */
824 -static int my_result(const char * msg, int ret, /*@null@*/ FILE * fp)
825 - /*@modifies *fp @*/
827 - /* HACK: don't print unless debugging. */
828 - if (_dav_debug >= 0)
833 - fprintf(fp, "*** %s: ", msg);
835 - /* HACK FTPERR_NE_FOO == -NE_FOO error impedance match */
837 - fprintf(fp, "%s: %s\n", ftpStrerror(-ret), ne_get_error(sess));
839 - fprintf(fp, "%s\n", ftpStrerror(-ret));
845 -static void hexdump(const unsigned char * buf, ssize_t len)
851 - for (i = 0; i < len; i++) {
852 - if (i != 0 && (i%16) == 0)
853 - fprintf(stderr, "\n");
854 - fprintf(stderr, " %02X", buf[i]);
856 - fprintf(stderr, "\n");
861 -static void davAcceptRanges(void * userdata, /*@null@*/ const char * value)
862 - /*@modifies userdata @*/
864 - urlinfo u = userdata;
866 - if (!(u != NULL && value != NULL)) return;
868 -fprintf(stderr, "*** u %p Accept-Ranges: %s\n", u, value);
869 - if (!strcmp(value, "bytes"))
870 - u->httpHasRange = 1;
871 - if (!strcmp(value, "none"))
872 - u->httpHasRange = 0;
876 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
877 -static void davAllHeaders(void * userdata, const char * value)
879 - FD_t ctrl = userdata;
881 - if (!(ctrl != NULL && value != NULL)) return;
883 -fprintf(stderr, "<- %s\n", value);
888 -static void davContentLength(void * userdata, /*@null@*/ const char * value)
889 - /*@modifies userdata @*/
891 - FD_t ctrl = userdata;
893 - if (!(ctrl != NULL && value != NULL)) return;
895 -fprintf(stderr, "*** fd %p Content-Length: %s\n", ctrl, value);
897 - ctrl->contentLength = strtoll(value, NULL, 10);
903 -static void davConnection(void * userdata, /*@null@*/ const char * value)
904 - /*@modifies userdata @*/
906 - FD_t ctrl = userdata;
908 - if (!(ctrl != NULL && value != NULL)) return;
910 -fprintf(stderr, "*** fd %p Connection: %s\n", ctrl, value);
911 - if (!strcasecmp(value, "close"))
913 - else if (!strcasecmp(value, "Keep-Alive"))
918 -/*@-mustmod@*/ /* HACK: stash error in *str. */
919 -int davResp(urlinfo u, FD_t ctrl, /*@unused@*/ char *const * str)
923 - rc = ne_begin_request(ctrl->req);
924 - rc = my_result("ne_begin_req(ctrl->req)", rc, NULL);
927 -fprintf(stderr, "*** davResp(%p,%p,%p) sess %p req %p rc %d\n", u, ctrl, str, u->sess, ctrl->req, rc);
929 - /* HACK FTPERR_NE_FOO == -NE_FOO error impedance match */
930 -/*@-observertrans@*/
932 - fdSetSyserrno(ctrl, errno, ftpStrerror(-rc));
933 -/*@=observertrans@*/
939 -int davReq(FD_t ctrl, const char * httpCmd, const char * httpArg)
944 -assert(ctrl != NULL);
949 -fprintf(stderr, "*** davReq(%p,%s,\"%s\") entry sess %p req %p\n", ctrl, httpCmd, (httpArg ? httpArg : ""), u->sess, ctrl->req);
951 - ctrl->persist = (u->httpVersion > 0 ? 1 : 0);
952 - ctrl = fdLink(ctrl, "open ctrl (davReq)");
954 -assert(u->sess != NULL);
955 -assert(ctrl->req == NULL);
957 - ctrl->req = ne_request_create(u->sess, httpCmd, httpArg);
959 -assert(ctrl->req != NULL);
961 - ne_set_request_private(ctrl->req, "fd", ctrl);
963 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
964 - ne_add_response_header_catcher(ctrl->req, davAllHeaders, ctrl);
966 - ne_add_response_header_handler(ctrl->req, "Content-Length",
967 - davContentLength, ctrl);
968 - ne_add_response_header_handler(ctrl->req, "Connection",
969 - davConnection, ctrl);
972 - if (!strcmp(httpCmd, "PUT")) {
973 -#if defined(HAVE_NEON_NE_SEND_REQUEST_CHUNK)
974 - ctrl->wr_chunked = 1;
975 - ne_add_request_header(ctrl->req, "Transfer-Encoding", "chunked");
976 - ne_set_request_chunked(ctrl->req, 1);
977 - /* HACK: no retries if/when chunking. */
978 - rc = davResp(u, ctrl, NULL);
980 - rc = FTPERR_SERVER_IO_ERROR;
983 - /* HACK: possible Last-Modified: Tue, 02 Nov 2004 14:29:36 GMT */
984 - /* HACK: possible ETag: "inode-size-mtime" */
985 -#if !defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
986 - ne_add_response_header_handler(ctrl->req, "Accept-Ranges",
987 - davAcceptRanges, u);
989 - /* HACK: possible Transfer-Encoding: on GET. */
991 - /* HACK: other errors may need retry too. */
992 - /* HACK: neon retries once, gud enuf. */
993 - /* HACK: retry counter? */
995 - rc = davResp(u, ctrl, NULL);
996 - } while (rc == NE_RETRY);
1001 -if (_dav_debug < 0)
1002 -fprintf(stderr, "*** davReq(%p,%s,\"%s\") exit sess %p req %p rc %d\n", ctrl, httpCmd, (httpArg ? httpArg : ""), u->sess, ctrl->req, rc);
1004 -#if defined(HAVE_NEON_NE_GET_RESPONSE_HEADER)
1005 - davContentLength(ctrl,
1006 - ne_get_response_header(ctrl->req, "Content-Length"));
1007 - davConnection(ctrl,
1008 - ne_get_response_header(ctrl->req, "Connection"));
1009 - if (strcmp(httpCmd, "PUT"))
1010 - davAcceptRanges(u,
1011 - ne_get_response_header(ctrl->req, "Accept-Ranges"));
1014 - ctrl = fdLink(ctrl, "open data (davReq)");
1018 -/*@-observertrans@*/
1019 - fdSetSyserrno(ctrl, errno, ftpStrerror(rc));
1020 -/*@=observertrans@*/
1022 - /* HACK balance fd refs. ne_session_destroy to tear down non-keepalive? */
1023 - ctrl = fdLink(ctrl, "error data (davReq)");
1028 -FD_t davOpen(const char * url, /*@unused@*/ int flags,
1029 - /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
1031 - const char * path = NULL;
1032 - urltype urlType = urlPath(url, &path);
1037 -#if 0 /* XXX makeTempFile() heartburn */
1038 - assert(!(flags & O_RDWR));
1041 -if (_dav_debug < 0)
1042 -fprintf(stderr, "*** davOpen(%s,0x%x,0%o,%p)\n", url, flags, mode, uret);
1043 - rc = davInit(url, &u);
1044 - if (rc || u == NULL || u->sess == NULL)
1047 - if (u->ctrl == NULL)
1048 - u->ctrl = fdNew("persist ctrl (davOpen)");
1049 - if (u->ctrl->nrefs > 2 && u->data == NULL)
1050 - u->data = fdNew("persist data (davOpen)");
1052 - if (u->ctrl->url == NULL)
1053 - fd = fdLink(u->ctrl, "grab ctrl (davOpen persist ctrl)");
1054 - else if (u->data->url == NULL)
1055 - fd = fdLink(u->data, "grab ctrl (davOpen persist data)");
1057 - fd = fdNew("grab ctrl (davOpen)");
1060 - fdSetOpen(fd, url, flags, mode);
1061 - fdSetIo(fd, ufdio);
1063 - fd->ftpFileDoneNeeded = 0;
1064 - fd->rd_timeoutsecs = httpTimeoutSecs;
1065 - fd->contentLength = fd->bytesRemain = -1;
1066 - fd->url = urlLink(u, "url (davOpen)");
1067 - fd = fdLink(fd, "grab data (davOpen)");
1068 -assert(urlType == URL_IS_HTTPS || urlType == URL_IS_HTTP || urlType == URL_IS_HKP);
1069 - fd->urlType = urlType;
1077 - /*@-refcounttrans@*/
1079 - /*@=refcounttrans@*/
1082 -ssize_t davRead(void * cookie, /*@out@*/ char * buf, size_t count)
1088 -assert(count >= 128); /* HACK: see ne_request.h comment */
1090 - rc = ne_read_response_block(fd->req, buf, count);
1092 -if (_dav_debug < 0) {
1093 -fprintf(stderr, "*** davRead(%p,%p,0x%x) rc 0x%x\n", cookie, buf, (unsigned)count, (unsigned)rc);
1102 -ssize_t davWrite(void * cookie, const char * buf, size_t count)
1108 -#if !defined(NEONBLOWSCHUNKS)
1109 - ne_session * sess;
1111 -assert(fd->req != NULL);
1112 - sess = ne_get_session(fd->req);
1113 -assert(sess != NULL);
1115 - /* HACK: include ne_private.h to access sess->socket for now. */
1116 - xx = ne_sock_fullwrite(sess->socket, buf, count);
1118 -#if defined(HAVE_NEON_NE_SEND_REQUEST_CHUNK) || defined(__LCLINT__)
1119 -assert(fd->req != NULL);
1120 - xx = ne_send_request_chunk(fd->req, buf, count);
1122 - errno = EIO; /* HACK */
1127 - /* HACK: stupid error impedence matching. */
1128 - rc = (xx == 0 ? count : -1);
1130 -if (_dav_debug < 0)
1131 -fprintf(stderr, "*** davWrite(%p,%p,0x%x) rc 0x%x\n", cookie, buf, (unsigned)count, (unsigned)rc);
1134 -hexdump(buf, count);
1140 -int davSeek(void * cookie, /*@unused@*/ _libio_pos_t pos, int whence)
1142 -if (_dav_debug < 0)
1143 -fprintf(stderr, "*** davSeek(%p,pos,%d)\n", cookie, whence);
1147 -/*@-mustmod@*/ /* HACK: fd->req is modified. */
1148 -int davClose(void * cookie)
1155 -assert(fd->req != NULL);
1156 - rc = ne_end_request(fd->req);
1157 - rc = my_result("ne_end_request(req)", rc, NULL);
1159 - ne_request_destroy(fd->req);
1162 -if (_dav_debug < 0)
1163 -fprintf(stderr, "*** davClose(%p) rc %d\n", fd, rc);
1168 -/* =============================================================== */
1169 -int davMkdir(const char * path, mode_t mode)
1172 - const char * src = NULL;
1175 - rc = davInit(path, &u);
1179 - (void) urlPath(path, &src);
1181 - rc = ne_mkcol(u->sess, path);
1183 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1185 - /* XXX HACK: verify getrestype(remote) == resr_collection */
1189 -fprintf(stderr, "*** davMkdir(%s,0%o) rc %d\n", path, mode, rc);
1193 -int davRmdir(const char * path)
1196 - const char * src = NULL;
1199 - rc = davInit(path, &u);
1203 - (void) urlPath(path, &src);
1205 - /* XXX HACK: only getrestype(remote) == resr_collection */
1207 - rc = ne_delete(u->sess, path);
1209 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1213 -fprintf(stderr, "*** davRmdir(%s) rc %d\n", path, rc);
1217 -int davRename(const char * oldpath, const char * newpath)
1220 - const char * src = NULL;
1221 - const char * dst = NULL;
1222 - int overwrite = 1; /* HACK: set this correctly. */
1225 - rc = davInit(oldpath, &u);
1229 - (void) urlPath(oldpath, &src);
1230 - (void) urlPath(newpath, &dst);
1232 - /* XXX HACK: only getrestype(remote) != resr_collection */
1234 - rc = ne_move(u->sess, overwrite, src, dst);
1236 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1240 -fprintf(stderr, "*** davRename(%s,%s) rc %d\n", oldpath, newpath, rc);
1244 -int davUnlink(const char * path)
1247 - const char * src = NULL;
1250 - rc = davInit(path, &u);
1254 - (void) urlPath(path, &src);
1256 - /* XXX HACK: only getrestype(remote) != resr_collection */
1258 - rc = ne_delete(u->sess, src);
1261 - if (rc) rc = -1; /* XXX HACK: errno impedance match */
1264 -fprintf(stderr, "*** davUnlink(%s) rc %d\n", path, rc);
1269 -static int davChdir(const char * path)
1270 - /*@globals h_errno, fileSystem, internalState @*/
1271 - /*@modifies fileSystem, internalState @*/
1273 - return davCommand("CWD", path, NULL);
1275 -#endif /* NOTYET */
1277 -/* =============================================================== */
1279 -static const char * statstr(const struct stat * st,
1280 - /*@returned@*/ /*@out@*/ char * buf)
1281 - /*@modifies *buf @*/
1284 - "*** dev %x ino %x mode %0o nlink %d uid %d gid %d rdev %x size %x\n",
1285 - (unsigned)st->st_dev,
1286 - (unsigned)st->st_ino,
1288 - (unsigned)st->st_nlink,
1291 - (unsigned)st->st_rdev,
1292 - (unsigned)st->st_size);
1297 -static int dav_st_ino = 0xdead0000;
1300 -int davStat(const char * path, /*@out@*/ struct stat *st)
1301 - /*@globals dav_st_ino, fileSystem, internalState @*/
1302 - /*@modifies *st, dav_st_ino, fileSystem, internalState @*/
1304 - struct fetch_context_s * ctx = NULL;
1308 -/* HACK: neon really wants collections with trailing '/' */
1309 - ctx = fetch_create_context(path);
1310 - if (ctx == NULL) {
1311 -/* HACK: errno = ??? */
1314 - rc = davNLST(ctx);
1316 -/* HACK: errno = ??? */
1320 - memset(st, 0, sizeof(*st));
1321 - st->st_mode = ctx->modes[0];
1322 - st->st_size = ctx->sizes[0];
1323 - st->st_mtime = ctx->mtimes[0];
1324 - if (S_ISDIR(st->st_mode)) {
1326 - st->st_mode |= 0755;
1328 - if (S_ISREG(st->st_mode)) {
1330 - st->st_mode |= 0644;
1333 - /* XXX fts(3) needs/uses st_ino, make something up for now. */
1334 - if (st->st_ino == 0)
1335 - st->st_ino = dav_st_ino++;
1336 -if (_dav_debug < 0)
1337 -fprintf(stderr, "*** davStat(%s) rc %d\n%s", path, rc, statstr(st, buf));
1339 - ctx = fetch_destroy_context(ctx);
1345 -int davLstat(const char * path, /*@out@*/ struct stat *st)
1346 - /*@globals dav_st_ino, fileSystem, internalState @*/
1347 - /*@modifies *st, dav_st_ino, fileSystem, internalState @*/
1349 - struct fetch_context_s * ctx = NULL;
1353 -/* HACK: neon really wants collections with trailing '/' */
1354 - ctx = fetch_create_context(path);
1355 - if (ctx == NULL) {
1356 -/* HACK: errno = ??? */
1359 - rc = davNLST(ctx);
1361 -/* HACK: errno = ??? */
1365 - memset(st, 0, sizeof(*st));
1366 - st->st_mode = ctx->modes[0];
1367 - st->st_size = ctx->sizes[0];
1368 - st->st_mtime = ctx->mtimes[0];
1369 - if (S_ISDIR(st->st_mode)) {
1371 - st->st_mode |= 0755;
1373 - if (S_ISREG(st->st_mode)) {
1375 - st->st_mode |= 0644;
1378 - /* XXX fts(3) needs/uses st_ino, make something up for now. */
1379 - if (st->st_ino == 0)
1380 - st->st_ino = dav_st_ino++;
1381 -if (_dav_debug < 0)
1382 -fprintf(stderr, "*** davLstat(%s) rc %d\n%s\n", path, rc, statstr(st, buf));
1384 - ctx = fetch_destroy_context(ctx);
1390 -static int davReadlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
1391 - /*@globals h_errno, fileSystem, internalState @*/
1392 - /*@modifies *buf, fileSystem, internalState @*/
1395 - rc = davNLST(path, DO_FTP_READLINK, NULL, buf, bufsiz);
1396 -if (_dav_debug < 0)
1397 -fprintf(stderr, "*** davReadlink(%s) rc %d\n", path, rc);
1400 -#endif /* NOTYET */
1402 -/* =============================================================== */
1404 int avmagicdir = 0x3607113;
1406 @@ -1518,171 +167,4 @@
1410 -/* =============================================================== */
1412 -int davmagicdir = 0x8440291;
1414 -int davClosedir(/*@only@*/ DIR * dir)
1416 - DAVDIR avdir = (DAVDIR)dir;
1418 -if (_dav_debug < 0)
1419 -fprintf(stderr, "*** davClosedir(%p)\n", avdir);
1421 -#if defined(HAVE_PTHREAD_H)
1422 -/*@-moduncon -noeffectuncon @*/
1423 - (void) pthread_mutex_destroy(&avdir->lock);
1424 -/*@=moduncon =noeffectuncon @*/
1427 - avdir = _free(avdir);
1431 -struct dirent * davReaddir(DIR * dir)
1433 - DAVDIR avdir = (DAVDIR)dir;
1434 - struct dirent * dp;
1436 - unsigned char * dt;
1440 - if (avdir == NULL || !ISDAVMAGIC(avdir) || avdir->data == NULL) {
1441 - /* XXX TODO: EBADF errno. */
1445 - dp = (struct dirent *) avdir->data;
1446 - av = (const char **) (dp + 1);
1448 - dt = (char *) (av + (ac + 1));
1449 - i = avdir->offset + 1;
1452 - if (i < 0 || i >= ac || av[i] == NULL)
1456 - avdir->offset = i;
1458 - /* XXX glob(3) uses REAL_DIR_ENTRY(dp) test on d_ino */
1460 - dp->d_ino = i + 1; /* W2DO? */
1461 - dp->d_reclen = 0; /* W2DO? */
1463 -#if !(defined(hpux) || defined(__hpux) || defined(sun))
1464 -#if !defined(__APPLE__)
1465 - dp->d_off = 0; /* W2DO? */
1468 - dp->d_type = dt[i];
1473 - strncpy(dp->d_name, av[i], sizeof(dp->d_name));
1474 -if (_dav_debug < 0)
1475 -fprintf(stderr, "*** davReaddir(%p) %p \"%s\"\n", (void *)avdir, dp, dp->d_name);
1481 -DIR * davOpendir(const char * path)
1483 - struct fetch_context_s * ctx;
1485 - struct dirent * dp;
1487 - const char ** av, ** nav;
1488 - unsigned char * dt;
1493 - /* HACK: glob does not pass dirs with trailing '/' */
1494 - nb = strlen(path)+1;
1496 - if (path[nb-1] != '/') {
1497 - char * npath = alloca(nb+1);
1499 - (void) stpcpy( stpcpy(npath, path), "/");
1504 -if (_dav_debug < 0)
1505 -fprintf(stderr, "*** davOpendir(%s)\n", path);
1507 - /* Load DAV collection into argv. */
1508 - ctx = fetch_create_context(path);
1509 - if (ctx == NULL) {
1510 -/* HACK: errno = ??? */
1513 - rc = davNLST(ctx);
1515 -/* HACK: errno = ??? */
1523 - while (av[ac] != NULL)
1524 - nb += strlen(av[ac++]) + 1;
1525 - ac += 2; /* for "." and ".." */
1526 - nb += sizeof(".") + sizeof("..");
1528 - nb += sizeof(*avdir) + sizeof(*dp) + ((ac + 1) * sizeof(*av)) + (ac + 1);
1529 - avdir = xcalloc(1, nb);
1531 - dp = (struct dirent *) (avdir + 1);
1532 - nav = (const char **) (dp + 1);
1533 - dt = (char *) (nav + (ac + 1));
1534 - t = (char *) (dt + ac + 1);
1537 - avdir->fd = davmagicdir;
1539 - avdir->data = (char *) dp;
1541 - avdir->allocation = nb;
1543 - avdir->offset = -1;
1544 - avdir->filepos = 0;
1546 -#if defined(HAVE_PTHREAD_H)
1547 -/*@-moduncon -noeffectuncon -nullpass @*/
1548 - (void) pthread_mutex_init(&avdir->lock, NULL);
1549 -/*@=moduncon =noeffectuncon =nullpass @*/
1553 -/*@-dependenttrans -unrecog@*/
1554 - dt[nac] = DT_DIR; nav[nac++] = t; t = stpcpy(t, "."); t++;
1555 - dt[nac] = DT_DIR; nav[nac++] = t; t = stpcpy(t, ".."); t++;
1556 -/*@=dependenttrans =unrecog@*/
1558 - /* Copy DAV items into DIR elments. */
1561 - while (av[ac] != NULL) {
1563 - dt[nac] = (S_ISDIR(ctx->modes[ac]) ? DT_DIR : DT_REG);
1564 - t = stpcpy(t, av[ac]);
1571 - ctx = fetch_destroy_context(ctx);
1574 - return (DIR *) avdir;
1578 diff -ur rpm-4.4.7.org/rpmio/rpmdav.h rpm-4.4.7/rpmio/rpmdav.h
1579 --- rpm-4.4.7.org/rpmio/rpmdav.h 2005-10-11 21:13:59.000000000 +0200
1580 +++ rpm-4.4.7/rpmio/rpmdav.h 2006-10-17 22:35:33.742783250 +0200
1582 extern int avmagicdir;
1583 #define ISAVMAGIC(_dir) (!memcmp((_dir), &avmagicdir, sizeof(avmagicdir)))
1588 -extern int davmagicdir;
1589 -#define ISDAVMAGIC(_dir) (!memcmp((_dir), &davmagicdir, sizeof(davmagicdir)))
1595 /*@globals fileSystem, internalState @*/
1596 /*@modifies fileSystem, internalState @*/;
1599 - * Send a http request.
1601 - * @param httpCmd http command
1602 - * @param httpArg http command argument (NULL if none)
1603 - * @returns 0 on success
1605 -int davReq(FD_t ctrl, const char * httpCmd, /*@null@*/ const char * httpArg)
1606 - /*@globals fileSystem, internalState @*/
1607 - /*@modifies ctrl, fileSystem, internalState @*/;
1610 - * Read a http response.
1613 - * @retval *str error msg
1614 - * @returns 0 on success
1617 -int davResp(urlinfo u, FD_t ctrl, /*@out@*/ /*@null@*/ char *const * str)
1618 - /*@globals fileSystem, internalState @*/
1619 - /*@modifies ctrl, *str, fileSystem, internalState @*/;
1625 -FD_t davOpen(const char * url, /*@unused@*/ int flags,
1626 - /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
1627 - /*@globals internalState @*/
1628 - /*@modifies *uret, internalState @*/;
1633 -ssize_t davRead(void * cookie, /*@out@*/ char * buf, size_t count)
1634 - /*@globals fileSystem, internalState @*/
1635 - /*@modifies buf, fileSystem, internalState @*/
1636 - /*@requires maxSet(buf) >= (count - 1) @*/
1637 - /*@ensures maxRead(buf) == result @*/;
1642 -ssize_t davWrite(void * cookie, const char * buf, size_t count)
1643 - /*@globals fileSystem, internalState @*/
1644 - /*@modifies fileSystem, internalState @*/;
1648 -int davSeek(void * cookie, _libio_pos_t pos, int whence)
1649 - /*@globals fileSystem, internalState @*/
1650 - /*@modifies fileSystem, internalState @*/;
1654 -int davClose(void * cookie)
1655 - /*@globals fileSystem, internalState @*/
1656 - /*@modifies cookie, fileSystem, internalState @*/;
1660 -int davMkdir(const char * path, mode_t mode)
1661 - /*@globals fileSystem, internalState @*/
1662 - /*@modifies fileSystem, internalState @*/;
1666 -int davRmdir(const char * path)
1667 - /*@globals fileSystem, internalState @*/
1668 - /*@modifies fileSystem, internalState @*/;
1672 -int davRename(const char * oldpath, const char * newpath)
1673 - /*@globals fileSystem, internalState @*/
1674 - /*@modifies fileSystem, internalState @*/;
1678 -int davUnlink(const char * path)
1679 - /*@globals fileSystem, internalState @*/
1680 - /*@modifies fileSystem, internalState @*/;
1683 - * Close a DAV collection.
1684 - * @param dir argv DIR
1685 - * @return 0 always
1687 -int davClosedir(/*@only@*/ DIR * dir)
1688 - /*@globals fileSystem @*/
1689 - /*@modifies dir, fileSystem @*/;
1692 - * Return next entry from a DAV collection.
1693 - * @param dir argv DIR
1694 - * @return next entry
1696 -/*@dependent@*/ /*@null@*/
1697 -struct dirent * davReaddir(DIR * dir)
1698 - /*@globals fileSystem @*/
1699 - /*@modifies fileSystem @*/;
1702 - * Create an argv directory from DAV collection.
1703 - * @param path URL for DAV collection path
1704 - * @return argv DIR
1707 -DIR * davOpendir(const char * path)
1708 - /*@globals fileSystem, internalState @*/
1709 - /*@modifies fileSystem, internalState @*/;
1714 -int davStat(const char * path, /*@out@*/ struct stat * st)
1715 - /*@globals fileSystem, internalState @*/
1716 - /*@modifies *st, fileSystem, internalState @*/;
1721 -int davLstat(const char * path, /*@out@*/ struct stat * st)
1722 - /*@globals fileSystem, internalState @*/
1723 - /*@modifies *st, fileSystem, internalState @*/;
1728 diff -ur rpm-4.4.7.org/rpmio/rpmio.c rpm-4.4.7/rpmio/rpmio.c
1729 --- rpm-4.4.7.org/rpmio/rpmio.c 2006-08-08 08:55:01.000000000 +0200
1730 +++ rpm-4.4.7/rpmio/rpmio.c 2006-10-17 22:18:38.135311750 +0200
1731 @@ -406,13 +406,6 @@
1733 fdstat_enter(fd, FDSTAT_READ);
1735 - /* HACK: flimsy wiring for davRead */
1736 - if (fd->req != NULL) {
1737 - rc = davRead(fd, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1738 - /* XXX Chunked davRead EOF. */
1740 - fd->bytesRemain = 0;
1742 rc = read(fdFileno(fd), buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1744 fdstat_exit(fd, FDSTAT_READ, rc);
1745 @@ -440,10 +433,6 @@
1747 fdstat_enter(fd, FDSTAT_WRITE);
1749 - /* HACK: flimsy wiring for davWrite */
1750 - if (fd->req != NULL)
1751 - rc = davWrite(fd, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1753 rc = write(fdno, buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
1755 fdstat_exit(fd, FDSTAT_WRITE, rc);
1756 @@ -490,11 +479,6 @@
1759 fdstat_enter(fd, FDSTAT_CLOSE);
1760 - /* HACK: flimsy wiring for davClose */
1762 - if (fd->req != NULL)
1763 - rc = davClose(fd);
1765 rc = ((fdno >= 0) ? close(fdno) : -2);
1767 fdstat_exit(fd, FDSTAT_CLOSE, rc);
1768 @@ -547,10 +531,6 @@
1772 - /* HACK: flimsy wiring for davWrite */
1773 - if (fd->req != NULL)
1776 if ((fdno = fdFileno(fd)) < 0)
1777 return -1; /* XXX W2DO? */
1779 @@ -602,10 +582,6 @@
1783 - /* HACK: flimsy wiring for davRead */
1784 - if (fd->req != NULL)
1787 if ((fdno = fdFileno(fd)) < 0)
1788 return -1; /* XXX W2DO? */
1790 @@ -1758,159 +1734,6 @@
1795 -static int httpResp(urlinfo u, FD_t ctrl, /*@out@*/ char ** str)
1796 - /*@globals fileSystem @*/
1797 - /*@modifies ctrl, *str, fileSystem @*/
1803 - rc = checkResponse(u, ctrl, &ec, str);
1805 -if (_ftp_debug && !(rc == 0 && (ec == 200 || ec == 201)))
1806 -fprintf(stderr, "*** httpResp: rc %d ec %d\n", rc, ec);
1810 - case 201: /* 201 Created. */
1812 - case 204: /* HACK: if overwriting, 204 No Content. */
1813 - case 403: /* 403 Forbidden. */
1814 - ctrl->syserrno = EACCES; /* HACK */
1815 - rc = FTPERR_UNKNOWN;
1818 - rc = FTPERR_FILE_NOT_FOUND;
1824 -static int httpReq(FD_t ctrl, const char * httpCmd, const char * httpArg)
1825 - /*@globals h_errno, fileSystem, internalState @*/
1826 - /*@modifies ctrl, fileSystem, internalState @*/
1829 - const char * host;
1830 - const char * path;
1831 - char hthost[NI_MAXHOST];
1838 -assert(ctrl != NULL);
1842 - if (((host = (u->proxyh ? u->proxyh : u->host)) == NULL))
1843 - return FTPERR_BAD_HOSTNAME;
1844 - if (strchr(host, ':'))
1845 - sprintf(hthost, "[%s]", host);
1847 - strcpy(hthost, host);
1849 - if ((port = (u->proxyp > 0 ? u->proxyp : u->port)) < 0) port = 80;
1850 - path = (u->proxyh || u->proxyp > 0) ? u->url : httpArg;
1851 - /*@-branchstate@*/
1852 - if (path == NULL) path = "";
1853 - /*@=branchstate@*/
1856 - /*@-branchstate@*/
1857 - if (fdFileno(ctrl) >= 0 && (rc = fdWritable(ctrl, 0)) < 1) {
1858 - /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
1860 - /*@=branchstate@*/
1863 - if (fdFileno(ctrl) < 0) {
1864 - rc = tcpConnect(ctrl, host, port);
1867 - ctrl = fdLink(ctrl, "open ctrl (httpReq)");
1871 -req x HTTP/1.0\r\n\
1872 -User-Agent: rpm/3.0.4\r\n\
1874 -Accept: text/plain\r\n\
1875 -Transfer-Encoding: chunked\r\n\
1877 -") + strlen(httpCmd) + strlen(path) + sizeof(VERSION) + strlen(hthost) + 20;
1880 - req = alloca(len);
1883 - if (!strcmp(httpCmd, "PUT")) {
1885 -%s %s HTTP/1.%d\r\n\
1886 -User-Agent: rpm/%s\r\n\
1888 -Accept: text/plain\r\n\
1889 -Transfer-Encoding: chunked\r\n\
1891 -", httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, hthost, port);
1894 -%s %s HTTP/1.%d\r\n\
1895 -User-Agent: rpm/%s\r\n\
1897 -Accept: text/plain\r\n\
1899 -", httpCmd, path, (u->httpVersion ? 1 : 0), VERSION, hthost, port);
1904 -fprintf(stderr, "-> %s", req);
1906 - len = strlen(req);
1907 - if (fdWrite(ctrl, req, len) != len) {
1908 - rc = FTPERR_SERVER_IO_ERROR;
1912 - /*@-branchstate@*/
1913 - if (!strcmp(httpCmd, "PUT")) {
1914 - ctrl->wr_chunked = 1;
1917 - rc = httpResp(u, ctrl, NULL);
1920 - if (!retrying) { /* not HTTP_OK */
1922 - /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
1928 - /*@=branchstate@*/
1930 - ctrl = fdLink(ctrl, "open data (httpReq)");
1934 - /*@-observertrans@*/
1935 - fdSetSyserrno(ctrl, errno, ftpStrerror(rc));
1936 - /*@=observertrans@*/
1938 - /*@-branchstate@*/
1939 - if (fdFileno(ctrl) >= 0)
1940 - /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/
1941 - /*@=branchstate@*/
1947 /* XXX DYING: unused */
1948 void * ufdGetUrlinfo(FD_t fd)
1950 @@ -2268,29 +2091,6 @@
1954 - case URL_IS_HTTPS:
1957 - fd = davOpen(url, flags, mode, &u);
1958 - if (fd == NULL || u == NULL)
1961 - cmd = ((flags & O_WRONLY)
1962 - ? ((flags & O_APPEND) ? "PUT" :
1963 - ((flags & O_CREAT) ? "PUT" : "PUT"))
1965 - u->openError = davReq(fd, cmd, path);
1966 - if (u->openError < 0) {
1967 - /* XXX make sure that we can exit through ufdClose */
1968 - fd = fdLink(fd, "error ctrl (ufdOpen HTTP)");
1969 - fd = fdLink(fd, "error data (ufdOpen HTTP)");
1971 - fd->bytesRemain = ((!strcmp(cmd, "GET"))
1972 - ? fd->contentLength : -1);
1973 - fd->wr_chunked = ((!strcmp(cmd, "PUT"))
1974 - ? fd->wr_chunked : 0);
1978 assert(!(flags & O_RDWR));
1979 fd = fdDup( ((flags & O_WRONLY) ? STDOUT_FILENO : STDIN_FILENO) );
1980 @@ -2908,10 +2708,8 @@
1981 if (fd->nfps > 0 && fpno == -1 &&
1982 fd->fps[fd->nfps-1].io == ufdio &&
1983 fd->fps[fd->nfps-1].fp == fp &&
1984 - (fd->fps[fd->nfps-1].fdno >= 0 || fd->req != NULL))
1985 + (fd->fps[fd->nfps-1].fdno >= 0))
1987 - int hadreqpersist = (fd->req != NULL);
1992 @@ -2921,26 +2719,9 @@
1994 if (fdGetFdno(fd) >= 0)
1997 - hadreqpersist = 0;
2001 - /* HACK: flimsy Keepalive wiring. */
2002 - if (hadreqpersist) {
2007 -/*@-refcounttrans@*/
2008 - (void) fdClose(fd);
2009 -/*@=refcounttrans@*/
2010 - fdSetFp(fd, NULL);
2012 -/*@-refcounttrans@*/
2013 - (void) fdClose(fd);
2014 -/*@=refcounttrans@*/
2019 @@ -3195,18 +2976,9 @@
2027 /* XXX gzdio and bzdio here too */
2029 switch (urlIsURL(path)) {
2030 - case URL_IS_HTTPS:
2038 @@ -3214,7 +2986,7 @@
2040 fprintf(stderr, "*** Fopen ufdio path %s fmode %s\n", path, fmode);
2041 fd = ufdOpen(path, flags, perms);
2042 - if (fd == NULL || !(fdFileno(fd) >= 0 || fd->req != NULL))
2043 + if (fd == NULL || !(fdFileno(fd) >= 0))
2047 @@ -3223,15 +2995,6 @@
2049 /*@notreached@*/ break;
2052 - /* XXX persistent HTTP/1.1 returns the previously opened fp */
2053 - if (isHTTP && ((fp = fdGetFp(fd)) != NULL) && ((fdno = fdGetFdno(fd)) >= 0 || fd->req != NULL))
2055 - /*@+voidabstract@*/
2056 - fdPush(fd, fpio, fp, fileno(fp)); /* Push fpio onto stack */
2057 - /*@=voidabstract@*/
2063 @@ -3267,10 +3030,6 @@
2066 if (fd == NULL) return -1;
2067 - if (fd->req != NULL) {
2068 - /* HACK: flimsy wiring for neon errors. */
2069 - rc = (fd->syserrno || fd->errcookie != NULL) ? -1 : 0;
2071 for (i = fd->nfps; rc == 0 && i >= 0; i--) {
2073 FDSTACK_t * fps = &fd->fps[i];
2074 @@ -3305,9 +3064,6 @@
2078 - if (fd->req != NULL)
2079 - rc = 123456789; /* HACK: https has no steenkin fileno. */
2081 for (i = fd->nfps ; rc == -1 && i >= 0; i--) {
2083 rc = fd->fps[i].fdno;
2084 diff -ur rpm-4.4.7.org/rpmio/rpmio_internal.h rpm-4.4.7/rpmio/rpmio_internal.h
2085 --- rpm-4.4.7.org/rpmio/rpmio_internal.h 2006-06-18 20:54:59.000000000 +0200
2086 +++ rpm-4.4.7/rpmio/rpmio_internal.h 2006-10-17 22:18:51.308135000 +0200
2089 void * url; /* ufdio: URL info */
2091 - void * req; /* ufdio: HTTP request */
2093 int rd_timeoutsecs; /* ufdRead: per FD_t timer */
2094 ssize_t bytesRemain; /* ufdio: */
2095 diff -ur rpm-4.4.7.org/rpmio/rpmrpc.c rpm-4.4.7/rpmio/rpmrpc.c
2096 --- rpm-4.4.7.org/rpmio/rpmrpc.c 2006-10-03 06:38:01.000000000 +0200
2097 +++ rpm-4.4.7/rpmio/rpmrpc.c 2006-10-17 22:35:59.040364250 +0200
2100 return ftpMkdir(path, mode);
2101 /*@notreached@*/ break;
2102 - case URL_IS_HTTPS:
2104 - return davMkdir(path, mode);
2105 - /*@notreached@*/ break;
2109 @@ -118,15 +114,6 @@
2111 return ftpChdir(path);
2112 /*@notreached@*/ break;
2113 - case URL_IS_HTTPS:
2116 - return davChdir(path);
2118 - errno = EINVAL; /* XXX W2DO? */
2121 - /*@notreached@*/ break;
2125 @@ -151,10 +138,6 @@
2127 return ftpRmdir(path);
2128 /*@notreached@*/ break;
2129 - case URL_IS_HTTPS:
2131 - return davRmdir(path);
2132 - /*@notreached@*/ break;
2139 case URL_IS_FTP: /* XXX TODO: implement. */
2140 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2141 - case URL_IS_HTTP: /* XXX TODO: implement. */
2143 errno = EINVAL; /* XXX W2DO? */
2145 @@ -208,10 +189,6 @@
2147 oldut = urlPath(oldpath, &oe);
2149 - case URL_IS_HTTPS:
2151 - return davRename(oldpath, newpath);
2152 - /*@notreached@*/ break;
2153 case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
2155 case URL_IS_UNKNOWN:
2158 return ftpRename(oldpath, newpath);
2159 /*@notreached@*/ break;
2160 - case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */
2161 - case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */
2167 oldut = urlPath(oldpath, &oe);
2169 - case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */
2170 - case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */
2171 case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
2173 case URL_IS_UNKNOWN:
2176 newut = urlPath(newpath, &ne);
2178 - case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */
2179 - case URL_IS_HTTP: /* XXX WRONG WRONG WRONG */
2180 case URL_IS_FTP: /* XXX WRONG WRONG WRONG */
2183 @@ -306,10 +277,6 @@
2185 return ftpUnlink(path);
2186 /*@notreached@*/ break;
2187 - case URL_IS_HTTPS:
2189 - return davUnlink(path);
2190 - /*@notreached@*/ break;
2194 @@ -1308,10 +1275,6 @@
2196 return ftpStat(path, st);
2197 /*@notreached@*/ break;
2198 - case URL_IS_HTTPS:
2200 - return davStat(path, st);
2201 - /*@notreached@*/ break;
2205 @@ -1338,10 +1301,6 @@
2207 return ftpLstat(path, st);
2208 /*@notreached@*/ break;
2209 - case URL_IS_HTTPS:
2211 - return davLstat(path, st);
2212 - /*@notreached@*/ break;
2216 @@ -1373,8 +1332,6 @@
2219 case URL_IS_FTP: /* XXX TODO: implement. */
2220 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2221 - case URL_IS_HTTP: /* XXX TODO: implement. */
2223 errno = EINVAL; /* XXX W2DO? */
2225 @@ -1399,8 +1356,6 @@
2228 case URL_IS_FTP: /* XXX TODO: implement. */
2229 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2230 - case URL_IS_HTTP: /* XXX TODO: implement. */
2232 errno = EINVAL; /* XXX W2DO? */
2234 @@ -1425,8 +1380,6 @@
2237 case URL_IS_FTP: /* XXX TODO: implement. */
2238 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2239 - case URL_IS_HTTP: /* XXX TODO: implement. */
2241 errno = EINVAL; /* XXX W2DO? */
2243 @@ -1451,8 +1404,6 @@
2246 case URL_IS_FTP: /* XXX TODO: implement. */
2247 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2248 - case URL_IS_HTTP: /* XXX TODO: implement. */
2250 errno = EINVAL; /* XXX W2DO? */
2252 @@ -1477,8 +1428,6 @@
2255 case URL_IS_FTP: /* XXX TODO: implement. */
2256 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2257 - case URL_IS_HTTP: /* XXX TODO: implement. */
2259 errno = EINVAL; /* XXX W2DO? */
2261 @@ -1503,8 +1452,6 @@
2264 case URL_IS_FTP: /* XXX TODO: implement. */
2265 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2266 - case URL_IS_HTTP: /* XXX TODO: implement. */
2268 errno = EINVAL; /* XXX W2DO? */
2270 @@ -1529,8 +1476,6 @@
2273 case URL_IS_FTP: /* XXX TODO: implement. */
2274 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2275 - case URL_IS_HTTP: /* XXX TODO: implement. */
2277 errno = EINVAL; /* XXX W2DO? */
2279 @@ -1558,8 +1503,6 @@
2282 case URL_IS_FTP: /* XXX TODO: implement. */
2283 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2284 - case URL_IS_HTTP: /* XXX TODO: implement. */
2286 errno = EINVAL; /* XXX W2DO? */
2288 @@ -1577,14 +1520,6 @@
2290 return ftpReadlink(path, buf, bufsiz);
2291 /*@notreached@*/ break;
2292 - case URL_IS_HTTPS:
2295 - return davReadlink(path, buf, bufsiz);
2299 - /*@notreached@*/ break;
2303 @@ -1617,8 +1552,6 @@
2307 - case URL_IS_HTTPS: /* XXX TODO: implement. */
2308 - case URL_IS_HTTP: /* XXX TODO: implement. */
2309 case URL_IS_FTP: /* XXX TODO: implement. */
2311 errno = EINVAL; /* XXX W2DO? */
2312 @@ -1685,8 +1618,6 @@
2313 fprintf(stderr, "*** Glob(%s,0x%x,%p,%p)\n", pattern, (unsigned)flags, (void *)errfunc, pglob);
2316 - case URL_IS_HTTPS:
2320 pglob->gl_closedir = Closedir;
2321 @@ -1730,10 +1661,6 @@
2323 return ftpOpendir(path);
2324 /*@notreached@*/ break;
2325 - case URL_IS_HTTPS:
2327 - return davOpendir(path);
2328 - /*@notreached@*/ break;
2332 @@ -1758,8 +1685,6 @@
2335 return avReaddir(dir);
2336 - if (ISDAVMAGIC(dir))
2337 - return davReaddir(dir);
2338 return readdir(dir);
2341 @@ -1771,8 +1696,6 @@
2344 return avClosedir(dir);
2345 - if (ISDAVMAGIC(dir))
2346 - return davClosedir(dir);
2347 return closedir(dir);
2350 diff -ur rpm-4.4.7.org/rpmio/tget.c rpm-4.4.7/rpmio/tget.c
2351 --- rpm-4.4.7.org/rpmio/tget.c 2004-11-19 17:52:58.000000000 +0100
2352 +++ rpm-4.4.7/rpmio/tget.c 2006-10-17 22:20:47.995427500 +0200
2355 static int _debug = 0;
2359 #define HTTPSPATH "https://localhost/test.txt"
2360 #define HTTPPATH "http://localhost/test.txt"
2361 #define FTPPATH "ftp://localhost/test.txt"
2363 { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL },
2364 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2365 N_("debug protocol data stream"), NULL},
2366 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2367 - N_("disable use of libneon for HTTP"), NULL},
2368 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2369 N_("debug rpmio I/O"), NULL},
2370 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2371 diff -ur rpm-4.4.7.org/rpmio/tglob.c rpm-4.4.7/rpmio/tglob.c
2372 --- rpm-4.4.7.org/rpmio/tglob.c 2004-11-19 17:53:05.000000000 +0100
2373 +++ rpm-4.4.7/rpmio/tglob.c 2006-10-17 22:21:01.712284750 +0200
2376 static int _debug = 0;
2380 #define HTTPSPATH "https://localhost/rawhide/test/*.rpm"
2382 #define HTTPPATH "http://localhost/rawhide/test/*.rpm"
2384 { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL },
2385 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2386 N_("debug protocol data stream"), NULL},
2387 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2388 - N_("disable use of libneon for HTTP"), NULL},
2389 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2390 N_("debug rpmio I/O"), NULL},
2391 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2392 diff -ur rpm-4.4.7.org/rpmio/thkp.c rpm-4.4.7/rpmio/thkp.c
2393 --- rpm-4.4.7.org/rpmio/thkp.c 2005-01-04 17:35:12.000000000 +0100
2394 +++ rpm-4.4.7/rpmio/thkp.c 2006-10-17 22:21:10.696846250 +0200
2396 static int _debug = 0;
2397 static int _printing = 0;
2402 #define HKPPATH "hkp://pgp.mit.edu:11371/pks/lookup?op=get&search=0xF5C75256"
2405 N_("debug protocol data stream"), NULL},
2406 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2407 N_("debug protocol data stream"), NULL},
2408 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2409 - N_("disable use of libneon for HTTP"), NULL},
2410 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2411 N_("debug rpmio I/O"), NULL},
2412 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2413 diff -ur rpm-4.4.7.org/rpmio/tput.c rpm-4.4.7/rpmio/tput.c
2414 --- rpm-4.4.7.org/rpmio/tput.c 2004-11-19 17:53:11.000000000 +0100
2415 +++ rpm-4.4.7/rpmio/tput.c 2006-10-17 22:21:25.841792750 +0200
2418 static int _debug = 0;
2422 #define HTTPSPATH "https://localhost/rawhide/toad/tput.txt"
2423 #define HTTPPATH "http://localhost/rawhide/toad/tput.txt"
2424 #define FTPPATH "ftp://localhost/home/test/tput.txt"
2426 { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL },
2427 { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
2428 N_("debug protocol data stream"), NULL},
2429 - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
2430 - N_("disable use of libneon for HTTP"), NULL},
2431 { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
2432 N_("debug rpmio I/O"), NULL},
2433 { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
2434 diff -ur rpm-4.4.7.org/rpmio/url.c rpm-4.4.7/rpmio/url.c
2435 --- rpm-4.4.7.org/rpmio/url.c 2006-08-06 02:31:18.000000000 +0200
2436 +++ rpm-4.4.7/rpmio/url.c 2006-10-17 22:21:51.747411750 +0200
2439 if (u->sess != NULL) {
2440 /* HACK: neon include has prototype. */
2441 - ne_session_destroy(u->sess);
2444 u->buf = _free(u->buf);
2447 { "file://", URL_IS_PATH },
2448 { "ftp://", URL_IS_FTP },
2449 - { "hkp://", URL_IS_HKP },
2450 - { "http://", URL_IS_HTTP },
2451 - { "https://", URL_IS_HTTPS },
2452 { "-", URL_IS_DASH },
2453 { NULL, URL_IS_UNKNOWN }