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