1 diff -ur httpd-2.0.52.org/include/ap_compat.h httpd-2.0.52/include/ap_compat.h
2 --- httpd-2.0.52.org/include/ap_compat.h 2004-10-02 18:25:54.675501812 +0200
3 +++ httpd-2.0.52/include/ap_compat.h 2004-10-02 18:26:13.003575452 +0200
7 /* Drag in apu (and therefore apr) renamed symbols */
8 -#include "apu_compat.h"
10 /* redefine 1.3.x symbols to the new symbol names */
12 diff -ur httpd-2.0.52.org/include/util_ldap.h httpd-2.0.52/include/util_ldap.h
13 --- httpd-2.0.52.org/include/util_ldap.h 2004-10-02 18:25:54.679500955 +0200
14 +++ httpd-2.0.52/include/util_ldap.h 2004-10-02 18:29:46.928747001 +0200
18 /* this whole thing disappears if LDAP is not enabled */
22 /* APR header files */
23 #include <apr_thread_mutex.h>
26 char *util_ald_cache_display(request_rec *r, util_ldap_state_t *st);
28 -#endif /* APU_HAS_LDAP */
29 +#endif /* APR_HAS_LDAP */
30 #endif /* UTIL_LDAP_H */
31 diff -ur httpd-2.0.52.org/modules/aaa/mod_auth_digest.c httpd-2.0.52/modules/aaa/mod_auth_digest.c
32 --- httpd-2.0.52.org/modules/aaa/mod_auth_digest.c 2004-10-02 18:25:54.710494315 +0200
33 +++ httpd-2.0.52/modules/aaa/mod_auth_digest.c 2004-10-02 18:26:13.010573952 +0200
35 unsigned long key; /* the key for this entry */
36 struct hash_entry *next; /* next entry in the bucket */
37 unsigned long nonce_count; /* for nonce-count checking */
38 - char ha1[2*MD5_DIGESTSIZE+1]; /* for algorithm=MD5-sess */
39 + char ha1[2*APR_MD5_DIGESTSIZE+1]; /* for algorithm=MD5-sess */
40 char last_nonce[NONCE_LEN+1]; /* for one-time nonce's */
43 diff -ur httpd-2.0.52.org/modules/cache/mod_file_cache.c httpd-2.0.52/modules/cache/mod_file_cache.c
44 --- httpd-2.0.52.org/modules/cache/mod_file_cache.c 2004-10-02 18:25:56.189177542 +0200
45 +++ httpd-2.0.52/modules/cache/mod_file_cache.c 2004-10-02 18:26:13.012573524 +0200
48 apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
50 - apr_mmap_dup(&mm, file->mm, r->pool, 0);
51 + apr_mmap_dup(&mm, file->mm, r->pool);
52 b = apr_bucket_mmap_create(mm, 0, (apr_size_t)file->finfo.size,
54 APR_BRIGADE_INSERT_TAIL(bb, b);
55 diff -ur httpd-2.0.52.org/modules/dav/fs/lock.c httpd-2.0.52/modules/dav/fs/lock.c
56 --- httpd-2.0.52.org/modules/dav/fs/lock.c 2004-10-02 18:25:54.715493244 +0200
57 +++ httpd-2.0.52/modules/dav/fs/lock.c 2004-10-02 18:26:13.016572667 +0200
61 /* if we don't see the file, then it's a locknull */
62 - rv = apr_lstat(&finfo, fname, APR_FINFO_MIN, p);
63 + rv = apr_stat(&finfo, fname, APR_FINFO_MIN | APR_FINFO_LINK, p);
64 if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) {
65 if ((err = dav_fs_remove_locknull_member(p, fname, &buf)) != NULL) {
66 /* ### push a higher-level description? */
67 diff -ur httpd-2.0.52.org/modules/dav/fs/repos.c httpd-2.0.52/modules/dav/fs/repos.c
68 --- httpd-2.0.52.org/modules/dav/fs/repos.c 2004-10-02 18:25:54.713493673 +0200
69 +++ httpd-2.0.52/modules/dav/fs/repos.c 2004-10-02 18:26:13.020571811 +0200
73 /* ### Optimize me, dirent can give us what we need! */
74 - status = apr_lstat(&fsctx->info1.finfo, fsctx->path1.buf,
75 - APR_FINFO_NORM, pool);
76 + status = apr_stat(&fsctx->info1.finfo, fsctx->path1.buf,
77 + APR_FINFO_NORM | APR_FINFO_LINK, pool);
78 if (status != APR_SUCCESS && status != APR_INCOMPLETE) {
79 /* woah! where'd it go? */
80 /* ### should have a better error here */
81 diff -ur httpd-2.0.52.org/modules/dav/main/util.c httpd-2.0.52/modules/dav/main/util.c
82 --- httpd-2.0.52.org/modules/dav/main/util.c 2004-10-02 18:25:54.724491317 +0200
83 +++ httpd-2.0.52/modules/dav/main/util.c 2004-10-02 18:26:13.025570740 +0200
85 /* now, verify that the URI uses the same scheme as the current.
86 request. the port must match our port.
88 - apr_sockaddr_port_get(&port, r->connection->local_addr);
89 + port = r->connection->local_addr->port;
90 if (strcasecmp(comp.scheme, scheme) != 0
91 #ifdef APACHE_PORT_HANDLING_IS_BUSTED
93 diff -ur httpd-2.0.52.org/modules/experimental/mod_auth_ldap.c httpd-2.0.52/modules/experimental/mod_auth_ldap.c
94 --- httpd-2.0.52.org/modules/experimental/mod_auth_ldap.c 2004-10-02 18:25:56.315150555 +0200
95 +++ httpd-2.0.52/modules/experimental/mod_auth_ldap.c 2004-10-02 18:26:13.028570097 +0200
97 #include "http_request.h"
98 #include "util_ldap.h"
100 -#ifndef APU_HAS_LDAP
101 +#ifndef APR_HAS_LDAP
102 #error mod_auth_ldap requires APR-util to have LDAP support built in
108 apr_ldap_url_desc_t *urld;
109 + apr_ldap_err_t *reserr;
111 mod_auth_ldap_config_t *sec = config;
113 @@ -702,16 +703,14 @@
114 cmd->server, "[%d] auth_ldap url parse: `%s'",
117 - result = apr_ldap_url_parse(url, &(urld));
118 + result = apr_ldap_url_parse(cmd->pool, url, &(urld), &reserr);
119 if (result != LDAP_SUCCESS) {
121 - case LDAP_URL_ERR_NOTLDAP:
122 + case APR_LDAP_URL_ERR_BADSCHEME:
123 return "LDAP URL does not begin with ldap://";
124 - case LDAP_URL_ERR_NODN:
125 - return "LDAP URL does not have a DN";
126 - case LDAP_URL_ERR_BADSCOPE:
127 + case APR_LDAP_URL_ERR_BADSCOPE:
128 return "LDAP URL has an invalid scope";
129 - case LDAP_URL_ERR_MEM:
130 + case APR_LDAP_URL_ERR_MEM:
131 return "Out of memory parsing LDAP URL";
133 return "Could not parse LDAP URL";
137 sec->have_ldap_url = 1;
138 - apr_ldap_free_urldesc(urld);
142 diff -ur httpd-2.0.52.org/modules/experimental/mod_cache.h httpd-2.0.52/modules/experimental/mod_cache.h
143 --- httpd-2.0.52.org/modules/experimental/mod_cache.h 2004-10-02 18:25:56.308152055 +0200
144 +++ httpd-2.0.52/modules/experimental/mod_cache.h 2004-10-02 18:26:13.030569669 +0200
146 void *vobj; /* Opaque portion (specific to the cache implementation) of the cache object */
147 apr_size_t count; /* Number of body bytes written to the cache so far */
149 - apr_atomic_t refcount;
150 + apr_uint32_t refcount;
154 diff -ur httpd-2.0.52.org/modules/experimental/mod_case_filter.c httpd-2.0.52/modules/experimental/mod_case_filter.c
155 --- httpd-2.0.52.org/modules/experimental/mod_case_filter.c 2004-10-02 18:25:56.324148628 +0200
156 +++ httpd-2.0.52/modules/experimental/mod_case_filter.c 2004-10-02 18:26:13.035568598 +0200
158 apr_bucket_brigade *pbbOut;
160 pbbOut=apr_brigade_create(r->pool, c->bucket_alloc);
161 - APR_BRIGADE_FOREACH(pbktIn,pbbIn)
162 + for(pbktIn = APR_BRIGADE_FIRST(pbbIn); pbktIn != APR_BRIGADE_SENTINEL(pbbIn); pbktIn = APR_BUCKET_NEXT(pbktIn))
166 diff -ur httpd-2.0.52.org/modules/experimental/mod_mem_cache.c httpd-2.0.52/modules/experimental/mod_mem_cache.c
167 --- httpd-2.0.52.org/modules/experimental/mod_mem_cache.c 2004-10-02 18:25:56.307152269 +0200
168 +++ httpd-2.0.52/modules/experimental/mod_mem_cache.c 2004-10-02 18:26:13.039567741 +0200
169 @@ -140,14 +140,14 @@
170 cache_object_t *obj = (cache_object_t *)a;
171 mem_cache_object_t *mobj = obj->vobj;
173 - apr_atomic_set(&mobj->pos, pos);
174 + apr_atomic_set32(&mobj->pos, pos);
176 static apr_ssize_t memcache_get_pos(void *a)
178 cache_object_t *obj = (cache_object_t *)a;
179 mem_cache_object_t *mobj = obj->vobj;
181 - return apr_atomic_read(&mobj->pos);
182 + return apr_atomic_read32(&mobj->pos);
185 static apr_size_t memcache_cache_get_size(void*a)
187 /* Decrement the refcount to account for the object being ejected
188 * from the cache. If the refcount is 0, free the object.
190 - if (!apr_atomic_dec(&obj->refcount)) {
191 + if (!apr_atomic_dec32(&obj->refcount)) {
192 cleanup_cache_object(obj);
196 tobj = cache_find(sconf->cache_cache, obj->key);
198 cache_remove(sconf->cache_cache, obj);
199 - apr_atomic_dec(&obj->refcount);
200 + apr_atomic_dec32(&obj->refcount);
203 apr_thread_mutex_unlock(sconf->lock);
207 /* If the refcount drops to 0, cleanup the cache object */
208 - if (!apr_atomic_dec(&obj->refcount)) {
209 + if (!apr_atomic_dec32(&obj->refcount)) {
210 cleanup_cache_object(obj);
214 obj = cache_pop(co->cache_cache);
216 /* Iterate over the cache and clean up each unreferenced entry */
217 - if (!apr_atomic_dec(&obj->refcount)) {
218 + if (!apr_atomic_dec32(&obj->refcount)) {
219 cleanup_cache_object(obj);
221 obj = cache_pop(co->cache_cache);
225 /* Finish initing the cache object */
226 - apr_atomic_set(&obj->refcount, 1);
227 + apr_atomic_set32(&obj->refcount, 1);
228 mobj->total_refs = 1;
232 * hashtable in the cache. Refcount should be 2 now, one
233 * for this thread, and one for the cache.
235 - apr_atomic_inc(&obj->refcount);
236 + apr_atomic_inc32(&obj->refcount);
239 apr_thread_mutex_unlock(sconf->lock);
243 request_rec *rmain=r, *rtmp;
244 - apr_atomic_inc(&obj->refcount);
245 + apr_atomic_inc32(&obj->refcount);
246 /* cache is worried about overall counts, not 'open' ones */
247 cache_update(sconf->cache_cache, obj);
250 tobj = cache_find(sconf->cache_cache, obj->key);
252 cache_remove(sconf->cache_cache, obj);
253 - apr_atomic_dec(&obj->refcount);
254 + apr_atomic_dec32(&obj->refcount);
260 cache_remove(sconf->cache_cache, obj);
261 /* For performance, cleanup cache object after releasing the lock */
262 - cleanup = !apr_atomic_dec(&obj->refcount);
263 + cleanup = !apr_atomic_dec32(&obj->refcount);
266 apr_thread_mutex_unlock(sconf->lock);
267 @@ -931,14 +931,14 @@
268 cache_remove(sconf->cache_cache, obj);
269 /* For illustration, cache no longer has reference to the object
270 * so decrement the refcount
271 - * apr_atomic_dec(&obj->refcount);
272 + * apr_atomic_dec32(&obj->refcount);
274 mobj->m_len = obj->count;
276 cache_insert(sconf->cache_cache, obj);
277 /* For illustration, cache now has reference to the object, so
278 * increment the refcount
279 - * apr_atomic_inc(&obj->refcount);
280 + * apr_atomic_inc32(&obj->refcount);
285 /* Object has been ejected from the cache, add it back to the cache */
286 mobj->m_len = obj->count;
287 cache_insert(sconf->cache_cache, obj);
288 - apr_atomic_inc(&obj->refcount);
289 + apr_atomic_inc32(&obj->refcount);
293 diff -ur httpd-2.0.52.org/modules/experimental/util_ldap.c httpd-2.0.52/modules/experimental/util_ldap.c
294 --- httpd-2.0.52.org/modules/experimental/util_ldap.c 2004-10-02 18:25:56.324148628 +0200
295 +++ httpd-2.0.52/modules/experimental/util_ldap.c 2004-10-02 18:26:13.043566884 +0200
300 -#ifndef APU_HAS_LDAP
301 +#ifndef APR_HAS_LDAP
302 #error mod_ldap requires APR-util to have LDAP support built in
305 diff -ur httpd-2.0.52.org/modules/experimental/util_ldap_cache.c httpd-2.0.52/modules/experimental/util_ldap_cache.c
306 --- httpd-2.0.52.org/modules/experimental/util_ldap_cache.c 2004-10-02 18:25:56.310151626 +0200
307 +++ httpd-2.0.52/modules/experimental/util_ldap_cache.c 2004-10-02 18:29:51.839694945 +0200
309 #include "util_ldap.h"
310 #include "util_ldap_cache.h"
315 #if APR_HAS_SHARED_MEMORY
316 #define MODLDAP_SHMEM_CACHE "/tmp/mod_ldap_cache"
321 -#endif /* APU_HAS_LDAP */
322 +#endif /* APR_HAS_LDAP */
323 diff -ur httpd-2.0.52.org/modules/experimental/util_ldap_cache.h httpd-2.0.52/modules/experimental/util_ldap_cache.h
324 --- httpd-2.0.52.org/modules/experimental/util_ldap_cache.h 2004-10-02 18:25:56.311151412 +0200
325 +++ httpd-2.0.52/modules/experimental/util_ldap_cache.h 2004-10-02 18:26:13.045566456 +0200
329 /* this whole thing disappears if LDAP is not enabled */
335 diff -ur httpd-2.0.52.org/modules/experimental/util_ldap_cache_mgr.c httpd-2.0.52/modules/experimental/util_ldap_cache_mgr.c
336 --- httpd-2.0.52.org/modules/experimental/util_ldap_cache_mgr.c 2004-10-02 18:25:56.312151198 +0200
337 +++ httpd-2.0.52/modules/experimental/util_ldap_cache_mgr.c 2004-10-02 18:29:58.135346250 +0200
339 #include "util_ldap_cache.h"
340 #include <apr_strings.h>
345 /* only here until strdup is gone */
351 -#endif /* APU_HAS_LDAP */
352 +#endif /* APR_HAS_LDAP */
353 diff -ur httpd-2.0.52.org/modules/filters/mod_deflate.c httpd-2.0.52/modules/filters/mod_deflate.c
354 --- httpd-2.0.52.org/modules/filters/mod_deflate.c 2004-10-02 18:25:56.233168118 +0200
355 +++ httpd-2.0.52/modules/filters/mod_deflate.c 2004-10-02 18:26:13.049565599 +0200
360 - APR_BRIGADE_FOREACH(bkt, ctx->bb) {
361 + for(bkt = APR_BRIGADE_FIRST(ctx->bb); bkt != APR_BRIGADE_SENTINEL(ctx->bb); bkt = APR_BUCKET_NEXT(bkt)) {
365 diff -ur httpd-2.0.52.org/modules/filters/mod_ext_filter.c httpd-2.0.52/modules/filters/mod_ext_filter.c
366 --- httpd-2.0.52.org/modules/filters/mod_ext_filter.c 2004-10-02 18:25:56.235167690 +0200
367 +++ httpd-2.0.52/modules/filters/mod_ext_filter.c 2004-10-02 18:26:13.329505629 +0200
368 @@ -487,18 +487,15 @@
370 #if APR_FILES_AS_SOCKETS
372 - apr_socket_t *newsock;
374 - rc = apr_poll_setup(&ctx->pollset, 2, ctx->p);
375 - ap_assert(rc == APR_SUCCESS);
376 - rc = apr_socket_from_file(&newsock, ctx->proc->in);
377 - ap_assert(rc == APR_SUCCESS);
378 - rc = apr_poll_socket_add(ctx->pollset, newsock, APR_POLLOUT);
379 - ap_assert(rc == APR_SUCCESS);
380 - rc = apr_socket_from_file(&newsock, ctx->proc->out);
381 - ap_assert(rc == APR_SUCCESS);
382 - rc = apr_poll_socket_add(ctx->pollset, newsock, APR_POLLIN);
383 - ap_assert(rc == APR_SUCCESS);
384 + ctx->pollset = apr_pcalloc(ctx->p, sizeof(apr_pollfd_t) * 2);
385 + ctx->pollset[0].p = ctx->p;
386 + ctx->pollset[0].desc.f = ctx->proc->in;
387 + ctx->pollset[0].desc_type = APR_POLL_FILE;
388 + ctx->pollset[0].reqevents = APR_POLLOUT;
389 + ctx->pollset[1].p = ctx->p;
390 + ctx->pollset[1].desc.f = ctx->proc->out;
391 + ctx->pollset[1].desc_type = APR_POLL_FILE;
392 + ctx->pollset[1].reqevents = APR_POLLIN;
400 - APR_BRIGADE_FOREACH(b, bb) {
401 + for(b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) {
403 if (APR_BUCKET_IS_EOS(b)) {
405 diff -ur httpd-2.0.52.org/modules/filters/mod_include.c httpd-2.0.52/modules/filters/mod_include.c
406 --- httpd-2.0.52.org/modules/filters/mod_include.c 2004-10-02 18:25:56.231168547 +0200
407 +++ httpd-2.0.52/modules/filters/mod_include.c 2004-10-02 18:26:13.343502630 +0200
409 val = ap_ht_time(r->pool, r->finfo.mtime, conf->default_time_fmt, 0);
411 else if (!strcasecmp(var, "USER_NAME")) {
412 - if (apr_get_username(&val, r->finfo.user, r->pool) != APR_SUCCESS) {
413 + if (apr_uid_name_get(&val, r->finfo.user, r->pool) != APR_SUCCESS) {
417 @@ -3004,7 +3004,7 @@
419 if (!APR_BRIGADE_EMPTY(pass_bb)) {
420 rv = ap_pass_brigade(f->next, pass_bb);
421 - if (!APR_STATUS_IS_SUCCESS(rv)) {
422 + if (rv != APR_SUCCESS) {
423 apr_brigade_destroy(pass_bb);
426 @@ -3025,11 +3025,11 @@
430 - if (!len || !APR_STATUS_IS_SUCCESS(rv)) {
431 + if (!len || (rv != APR_SUCCESS)) {
432 rv = apr_bucket_read(b, &data, &len, APR_BLOCK_READ);
435 - if (!APR_STATUS_IS_SUCCESS(rv)) {
436 + if (rv != APR_SUCCESS) {
437 apr_brigade_destroy(pass_bb);
440 diff -ur httpd-2.0.52.org/modules/generators/mod_autoindex.c httpd-2.0.52/modules/generators/mod_autoindex.c
441 --- httpd-2.0.52.org/modules/generators/mod_autoindex.c 2004-10-02 18:25:56.335146272 +0200
442 +++ httpd-2.0.52/modules/generators/mod_autoindex.c 2004-10-02 18:26:13.419486353 +0200
446 #ifdef CASE_BLIND_FILESYSTEM
447 -#define MATCH_FLAGS FNM_CASE_BLIND
448 +#define MATCH_FLAGS APR_FNM_CASE_BLIND
450 #define MATCH_FLAGS 0
452 @@ -1259,7 +1259,7 @@
454 #ifndef CASE_BLIND_FILESYSTEM
455 if (pattern && (apr_fnmatch(pattern, dirent->name,
456 - FNM_NOESCAPE | FNM_PERIOD)
457 + APR_FNM_NOESCAPE | APR_FNM_PERIOD)
460 #else /* !CASE_BLIND_FILESYSTEM */
461 @@ -1269,7 +1269,7 @@
462 * reliably - so we have to granularise at the OS level.
464 if (pattern && (apr_fnmatch(pattern, dirent->name,
465 - FNM_NOESCAPE | FNM_PERIOD | FNM_CASE_BLIND)
466 + APR_FNM_NOESCAPE | APR_FNM_PERIOD | APR_FNM_CASE_BLIND)
469 #endif /* !CASE_BLIND_FILESYSTEM */
470 diff -ur httpd-2.0.52.org/modules/generators/mod_cgi.c httpd-2.0.52/modules/generators/mod_cgi.c
471 --- httpd-2.0.52.org/modules/generators/mod_cgi.c 2004-10-02 18:25:56.337145843 +0200
472 +++ httpd-2.0.52/modules/generators/mod_cgi.c 2004-10-02 18:26:13.424485282 +0200
474 apr_file_printf(f, "%s\n", sbuf);
477 - APR_BRIGADE_FOREACH(e, bb) {
478 + for(e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) {
479 if (APR_BUCKET_IS_EOS(e)) {
483 /* Bad things happened. Everyone should have cleaned up. */
484 ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, rc, r,
485 "couldn't create child process: %d: %s", rc,
486 - apr_filename_of_pathname(r->filename));
487 + apr_filepath_name_get(r->filename));
490 apr_pool_note_subprocess(p, procnew, APR_KILL_AFTER_TIMEOUT);
495 - APR_BRIGADE_FOREACH(e, bb) {
496 + for(e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) {
497 if (APR_BUCKET_IS_EOS(e)) {
504 - argv0 = apr_filename_of_pathname(r->filename);
505 + argv0 = apr_filepath_name_get(r->filename);
506 nph = !(strncmp(argv0, "nph-", 4));
507 conf = ap_get_module_config(r->server->module_config, &cgi_module);
513 - APR_BRIGADE_FOREACH(bucket, bb) {
514 + for(bucket = APR_BRIGADE_FIRST(bb); bucket != APR_BRIGADE_SENTINEL(bb); bucket = APR_BUCKET_NEXT(bucket)) {
518 diff -ur httpd-2.0.52.org/modules/generators/mod_cgid.c httpd-2.0.52/modules/generators/mod_cgid.c
519 --- httpd-2.0.52.org/modules/generators/mod_cgid.c 2004-10-02 18:25:56.369138990 +0200
520 +++ httpd-2.0.52/modules/generators/mod_cgid.c 2004-10-02 18:26:13.431483782 +0200
523 ap_log_error(APLOG_MARK, APLOG_ERR, rc, r->server,
524 "couldn't create child process: %d: %s", rc,
525 - apr_filename_of_pathname(r->filename));
526 + apr_filepath_name_get(r->filename));
529 /* We don't want to leak storage for the key, so only allocate
530 @@ -1030,12 +1030,12 @@
531 apr_file_printf(f, "%s\n", sbuf);
534 - APR_BRIGADE_FOREACH(e, bb) {
535 + for(e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) {
536 if (APR_BUCKET_IS_EOS(e)) {
539 rv = apr_bucket_read(e, &buf, &len, APR_BLOCK_READ);
540 - if (!APR_STATUS_IS_SUCCESS(rv) || (len == 0)) {
541 + if ((rv != APR_SUCCESS) || (len == 0)) {
545 @@ -1131,12 +1131,12 @@
549 - APR_BRIGADE_FOREACH(e, bb) {
550 + for(e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) {
551 if (APR_BUCKET_IS_EOS(e)) {
554 rv = apr_bucket_read(e, &buf, &len, APR_BLOCK_READ);
555 - if (!APR_STATUS_IS_SUCCESS(rv)) {
556 + if (rv != APR_SUCCESS) {
560 @@ -1370,7 +1370,7 @@
564 - APR_BRIGADE_FOREACH(bucket, bb) {
565 + for(bucket = APR_BRIGADE_FIRST(bb); bucket != APR_BRIGADE_SENTINEL(bb); bucket = APR_BUCKET_NEXT(bucket)) {
569 diff -ur httpd-2.0.52.org/modules/http/http_core.c httpd-2.0.52/modules/http/http_core.c
570 --- httpd-2.0.52.org/modules/http/http_core.c 2004-10-02 18:25:55.959226804 +0200
571 +++ httpd-2.0.52/modules/http/http_core.c 2004-10-02 18:26:13.435482926 +0200
574 char chunk_hdr[20]; /* enough space for the snprintf below */
576 - APR_BRIGADE_FOREACH(e, b) {
577 + for(e = APR_BRIGADE_FIRST(b); e != APR_BRIGADE_SENTINEL(b); e = APR_BUCKET_NEXT(e)) {
578 if (APR_BUCKET_IS_EOS(e)) {
579 /* there shouldn't be anything after the eos */
581 diff -ur httpd-2.0.52.org/modules/http/http_protocol.c httpd-2.0.52/modules/http/http_protocol.c
582 --- httpd-2.0.52.org/modules/http/http_protocol.c 2004-10-02 18:25:55.957227232 +0200
583 +++ httpd-2.0.52/modules/http/http_protocol.c 2004-10-02 18:26:13.443481212 +0200
584 @@ -1534,7 +1534,7 @@
588 - APR_BRIGADE_FOREACH(e, b) {
589 + for(e = APR_BRIGADE_FIRST(b); e != APR_BRIGADE_SENTINEL(b); e = APR_BUCKET_NEXT(e)) {
590 if (e->type == &ap_bucket_type_error) {
591 ap_bucket_error *eb = e->data;
593 @@ -1976,7 +1976,7 @@
597 - APR_BRIGADE_FOREACH(bucket, bb) {
598 + for(bucket = APR_BRIGADE_FIRST(bb); bucket != APR_BRIGADE_SENTINEL(bb); bucket = APR_BUCKET_NEXT(bucket)) {
602 diff -ur httpd-2.0.52.org/modules/mappers/mod_negotiation.c httpd-2.0.52/modules/mappers/mod_negotiation.c
603 --- httpd-2.0.52.org/modules/mappers/mod_negotiation.c 2004-10-02 18:25:56.206173901 +0200
604 +++ httpd-2.0.52/modules/mappers/mod_negotiation.c 2004-10-02 18:26:13.449479927 +0200
608 mime_info.bytes = len;
609 - mime_info.file_name = apr_filename_of_pathname(rr->filename);
610 + mime_info.file_name = apr_filepath_name_get(rr->filename);
614 diff -ur httpd-2.0.52.org/modules/mappers/mod_rewrite.c httpd-2.0.52/modules/mappers/mod_rewrite.c
615 --- httpd-2.0.52.org/modules/mappers/mod_rewrite.c 2004-10-02 18:25:56.203174544 +0200
616 +++ httpd-2.0.52/modules/mappers/mod_rewrite.c 2004-10-02 18:26:13.457478214 +0200
617 @@ -2323,7 +2323,7 @@
619 else if (strcmp(p->pattern, "-l") == 0) {
621 - if (apr_lstat(&sb, input, APR_FINFO_MIN, r->pool) == APR_SUCCESS) {
622 + if (apr_stat(&sb, input, APR_FINFO_MIN | APR_FINFO_LINK, r->pool) == APR_SUCCESS) {
623 if (sb.filetype == APR_LNK) {
626 @@ -2949,7 +2949,7 @@
629 /* lookup username in systems passwd file */
630 - if (apr_get_home_directory(&homedir, user, r->pool) == APR_SUCCESS) {
631 + if (apr_uid_homepath_get(&homedir, user, r->pool) == APR_SUCCESS) {
632 /* ok, user was found, so expand the ~user string */
633 if (uri[i] != '\0') {
634 /* ~user/anything... has to be expanded */
635 @@ -3962,13 +3962,13 @@
636 else if (strcasecmp(var, "SCRIPT_USER") == 0) {
637 result = "<unknown>";
638 if (r->finfo.valid & APR_FINFO_USER) {
639 - apr_get_username((char **)&result, r->finfo.user, r->pool);
640 + apr_uid_name_get((char **)&result, r->finfo.user, r->pool);
643 else if (strcasecmp(var, "SCRIPT_GROUP") == 0) {
644 result = "<unknown>";
645 if (r->finfo.valid & APR_FINFO_GROUP) {
646 - apr_group_name_get((char **)&result, r->finfo.group, r->pool);
647 + apr_gid_name_get((char **)&result, r->finfo.group, r->pool);
649 } else if (strcasecmp(var, "HTTPS") == 0) {
650 int flag = rewrite_is_https && rewrite_is_https(r->connection);
651 diff -ur httpd-2.0.52.org/modules/mappers/mod_userdir.c httpd-2.0.52/modules/mappers/mod_userdir.c
652 --- httpd-2.0.52.org/modules/mappers/mod_userdir.c 2004-10-02 18:25:56.215171973 +0200
653 +++ httpd-2.0.52/modules/mappers/mod_userdir.c 2004-10-02 18:26:13.459477785 +0200
658 - if (apr_get_home_directory(&homedir, w, r->pool) == APR_SUCCESS) {
659 + if (apr_uid_homepath_get(&homedir, w, r->pool) == APR_SUCCESS) {
660 filename = apr_pstrcat(r->pool, homedir, "/", userdir, NULL);
667 - if (apr_get_userid(&ugid->uid, &ugid->gid, username, r->pool) != APR_SUCCESS) {
668 + if (apr_uid_get(&ugid->uid, &ugid->gid, username, r->pool) != APR_SUCCESS) {
672 diff -ur httpd-2.0.52.org/modules/proxy/proxy_connect.c httpd-2.0.52/modules/proxy/proxy_connect.c
673 --- httpd-2.0.52.org/modules/proxy/proxy_connect.c 2004-10-02 18:25:56.197175829 +0200
674 +++ httpd-2.0.52/modules/proxy/proxy_connect.c 2004-10-02 18:26:13.463476929 +0200
675 @@ -224,10 +224,10 @@
676 "proxy: CONNECT: sending the CONNECT request to the remote proxy");
677 nbytes = apr_snprintf(buffer, sizeof(buffer),
678 "CONNECT %s HTTP/1.0" CRLF, r->uri);
679 - apr_send(sock, buffer, &nbytes);
680 + apr_socket_send(sock, buffer, &nbytes);
681 nbytes = apr_snprintf(buffer, sizeof(buffer),
682 "Proxy-agent: %s" CRLF CRLF, ap_get_server_version());
683 - apr_send(sock, buffer, &nbytes);
684 + apr_socket_send(sock, buffer, &nbytes);
687 ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
688 @@ -235,11 +235,11 @@
689 nbytes = apr_snprintf(buffer, sizeof(buffer),
690 "HTTP/1.0 200 Connection Established" CRLF);
691 ap_xlate_proto_to_ascii(buffer, nbytes);
692 - apr_send(client_socket, buffer, &nbytes);
693 + apr_socket_send(client_socket, buffer, &nbytes);
694 nbytes = apr_snprintf(buffer, sizeof(buffer),
695 "Proxy-agent: %s" CRLF CRLF, ap_get_server_version());
696 ap_xlate_proto_to_ascii(buffer, nbytes);
697 - apr_send(client_socket, buffer, &nbytes);
698 + apr_socket_send(client_socket, buffer, &nbytes);
700 /* This is safer code, but it doesn't work yet. I'm leaving it
701 * here so that I can fix it later.
704 /* r->sent_bodyct = 1;*/
706 - if((rv = apr_poll_setup(&pollfd, 2, r->pool)) != APR_SUCCESS)
707 + if((pollfd = apr_pcalloc(r->pool, sizeof(apr_pollfd_t) * 2)) == NULL)
709 apr_socket_close(sock);
710 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
711 @@ -271,10 +271,16 @@
714 /* Add client side to the poll */
715 - apr_poll_socket_add(pollfd, client_socket, APR_POLLIN);
716 + pollfd[0].p = r->pool;
717 + pollfd[0].desc.s = client_socket;
718 + pollfd[0].desc_type = APR_POLL_SOCKET;
719 + pollfd[0].reqevents = APR_POLLIN;
721 /* Add the server side to the poll */
722 - apr_poll_socket_add(pollfd, sock, APR_POLLIN);
723 + pollfd[1].p = r->pool;
724 + pollfd[1].desc.s = sock;
725 + pollfd[1].desc_type = APR_POLL_SOCKET;
726 + pollfd[1].reqevents = APR_POLLIN;
728 while (1) { /* Infinite loop until error (one side closes the connection) */
729 /* ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: CONNECT: going to sleep (poll)");*/
730 @@ -288,12 +294,12 @@
731 "proxy: CONNECT: woke from select(), i=%d", pollcnt);*/
734 - apr_poll_revents_get(&pollevent, sock, pollfd);
735 + pollevent = pollfd[1].rtnevents;
736 if (pollevent & APR_POLLIN) {
737 /* ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
738 "proxy: CONNECT: sock was set");*/
739 nbytes = sizeof(buffer);
740 - if (apr_recv(sock, buffer, &nbytes) == APR_SUCCESS) {
741 + if (apr_socket_recv(sock, buffer, &nbytes) == APR_SUCCESS) {
746 * if ((nbytes = ap_rwrite(buffer + o, nbytes, r)) < 0)
749 - if (apr_send(client_socket, buffer + o, &nbytes) != APR_SUCCESS)
750 + if (apr_socket_send(client_socket, buffer + o, &nbytes) != APR_SUCCESS)
754 @@ -318,18 +324,18 @@
758 - apr_poll_revents_get(&pollevent, client_socket, pollfd);
759 + pollevent = pollfd[0].rtnevents;
760 if (pollevent & APR_POLLIN) {
761 /* ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
762 "proxy: CONNECT: client was set");*/
763 nbytes = sizeof(buffer);
764 - if (apr_recv(client_socket, buffer, &nbytes) == APR_SUCCESS) {
765 + if (apr_socket_recv(client_socket, buffer, &nbytes) == APR_SUCCESS) {
771 - if (apr_send(sock, buffer + o, &nbytes) != APR_SUCCESS)
772 + if (apr_socket_send(sock, buffer + o, &nbytes) != APR_SUCCESS)
776 diff -ur httpd-2.0.52.org/modules/proxy/proxy_ftp.c httpd-2.0.52/modules/proxy/proxy_ftp.c
777 --- httpd-2.0.52.org/modules/proxy/proxy_ftp.c 2004-10-02 18:25:56.196176043 +0200
778 +++ httpd-2.0.52/modules/proxy/proxy_ftp.c 2004-10-02 18:26:13.468475858 +0200
781 while (connect_addr) {
783 - if ((rv = apr_socket_create(&sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) {
784 + if ((rv = apr_socket_create(&sock, connect_addr->family, SOCK_STREAM, APR_PROTO_TCP, r->pool)) != APR_SUCCESS) {
785 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
786 "proxy: FTP: error creating socket");
787 connect_addr = connect_addr->next;
789 connect_addr->family, connect_addr, connectname);
791 /* make the connection out of the socket */
792 - rv = apr_connect(sock, connect_addr);
793 + rv = apr_socket_connect(sock, connect_addr);
795 /* if an error occurred, loop round and try again */
796 if (rv != APR_SUCCESS) {
797 @@ -1249,7 +1249,7 @@
798 "proxy: FTP: EPSV contacting remote host on port %d",
801 - if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) {
802 + if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, APR_PROTO_TCP, r->pool)) != APR_SUCCESS) {
803 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
804 "proxy: FTP: error creating EPSV socket");
805 return HTTP_INTERNAL_SERVER_ERROR;
806 @@ -1268,7 +1268,7 @@
807 apr_socket_addr_get(&data_addr, APR_REMOTE, sock);
808 apr_sockaddr_ip_get(&data_ip, data_addr);
809 apr_sockaddr_info_get(&epsv_addr, data_ip, connect_addr->family, data_port, 0, p);
810 - rv = apr_connect(data_sock, epsv_addr);
811 + rv = apr_socket_connect(data_sock, epsv_addr);
812 if (rv != APR_SUCCESS) {
813 ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
814 "proxy: FTP: EPSV attempt to connect to %pI failed - Firewall/NAT?", epsv_addr);
815 @@ -1336,7 +1336,7 @@
816 "proxy: FTP: PASV contacting host %d.%d.%d.%d:%d",
817 h3, h2, h1, h0, pasvport);
819 - if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) {
820 + if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, APR_PROTO_TCP, r->pool)) != APR_SUCCESS) {
821 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
822 "proxy: error creating PASV socket");
823 return HTTP_INTERNAL_SERVER_ERROR;
824 @@ -1353,7 +1353,7 @@
826 /* make the connection */
827 apr_sockaddr_info_get(&pasv_addr, apr_psprintf(p, "%d.%d.%d.%d", h3, h2, h1, h0), connect_addr->family, pasvport, 0, p);
828 - rv = apr_connect(data_sock, pasv_addr);
829 + rv = apr_socket_connect(data_sock, pasv_addr);
830 if (rv != APR_SUCCESS) {
831 ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
832 "proxy: FTP: PASV attempt to connect to %pI failed - Firewall/NAT?", pasv_addr);
833 @@ -1379,13 +1379,13 @@
834 apr_port_t local_port;
835 unsigned int h0, h1, h2, h3, p0, p1;
837 - if ((rv = apr_socket_create(&local_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) {
838 + if ((rv = apr_socket_create(&local_sock, connect_addr->family, SOCK_STREAM, APR_PROTO_TCP, r->pool)) != APR_SUCCESS) {
839 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
840 "proxy: FTP: error creating local socket");
841 return HTTP_INTERNAL_SERVER_ERROR;
843 apr_socket_addr_get(&local_addr, APR_LOCAL, sock);
844 - apr_sockaddr_port_get(&local_port, local_addr);
845 + local_port = local_addr->port;
846 apr_sockaddr_ip_get(&local_ip, local_addr);
848 if ((rv = apr_socket_opt_set(local_sock, APR_SO_REUSEADDR, one))
849 @@ -1399,14 +1399,14 @@
851 apr_sockaddr_info_get(&local_addr, local_ip, APR_UNSPEC, local_port, 0, r->pool);
853 - if ((rv = apr_bind(local_sock, local_addr)) != APR_SUCCESS) {
854 + if ((rv = apr_socket_bind(local_sock, local_addr)) != APR_SUCCESS) {
855 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
856 "proxy: FTP: error binding to ftp data socket %pI", local_addr);
857 return HTTP_INTERNAL_SERVER_ERROR;
860 /* only need a short queue */
861 - if ((rv = apr_listen(local_sock, 2)) != APR_SUCCESS) {
862 + if ((rv = apr_socket_listen(local_sock, 2)) != APR_SUCCESS) {
863 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
864 "proxy: FTP: error listening to ftp data socket %pI", local_addr);
865 return HTTP_INTERNAL_SERVER_ERROR;
866 @@ -1743,7 +1743,7 @@
867 /* wait for connection */
870 - rv = apr_accept(&data_sock, local_sock, r->pool);
871 + rv = apr_socket_accept(&data_sock, local_sock, r->pool);
872 if (rv == APR_EINTR) {
875 diff -ur httpd-2.0.52.org/modules/proxy/proxy_http.c httpd-2.0.52/modules/proxy/proxy_http.c
876 --- httpd-2.0.52.org/modules/proxy/proxy_http.c 2004-10-02 18:25:56.191177114 +0200
877 +++ httpd-2.0.52/modules/proxy/proxy_http.c 2004-10-02 18:26:13.471475215 +0200
879 apr_socket_timeout_get(p_conn->sock, ¤t_timeout);
881 apr_socket_timeout_set(p_conn->sock, 0);
882 - socket_status = apr_recv(p_conn->sock, test_buffer, &buffer_len);
883 + socket_status = apr_socket_recv(p_conn->sock, test_buffer, &buffer_len);
884 /* put back old timeout */
885 apr_socket_timeout_set(p_conn->sock, current_timeout);
886 if ( APR_STATUS_IS_EOF(socket_status) ) {
887 diff -ur httpd-2.0.52.org/modules/proxy/proxy_util.c httpd-2.0.52/modules/proxy/proxy_util.c
888 --- httpd-2.0.52.org/modules/proxy/proxy_util.c 2004-10-02 18:25:56.194176471 +0200
889 +++ httpd-2.0.52/modules/proxy/proxy_util.c 2004-10-02 18:26:13.475474358 +0200
890 @@ -1102,7 +1102,7 @@
892 while (backend_addr && !connected) {
893 if ((rv = apr_socket_create(newsock, backend_addr->family,
894 - SOCK_STREAM, p)) != APR_SUCCESS) {
895 + SOCK_STREAM, APR_PROTO_TCP, p)) != APR_SUCCESS) {
896 loglevel = backend_addr->next ? APLOG_DEBUG : APLOG_ERR;
897 ap_log_error(APLOG_MARK, loglevel, rv, s,
898 "proxy: %s: error creating fam %d socket for target %s",
899 @@ -1140,7 +1140,7 @@
900 proxy_function, backend_addr->family, backend_name);
902 /* make the connection out of the socket */
903 - rv = apr_connect(*newsock, backend_addr);
904 + rv = apr_socket_connect(*newsock, backend_addr);
906 /* if an error occurred, loop round and try again */
907 if (rv != APR_SUCCESS) {
908 diff -ur httpd-2.0.52.org/modules/ssl/mod_ssl.c httpd-2.0.52/modules/ssl/mod_ssl.c
909 --- httpd-2.0.52.org/modules/ssl/mod_ssl.c 2004-10-02 18:25:54.741487676 +0200
910 +++ httpd-2.0.52/modules/ssl/mod_ssl.c 2004-10-02 18:26:13.477473930 +0200
914 if (!SSL_set_session_id_context(ssl, (unsigned char *)vhost_md5,
916 + APR_MD5_DIGESTSIZE*2))
918 ap_log_error(APLOG_MARK, APLOG_ERR, 0, c->base_server,
919 "Unable to set session id context to `%s'", vhost_md5);
920 diff -ur httpd-2.0.52.org/modules/ssl/ssl_engine_init.c httpd-2.0.52/modules/ssl/ssl_engine_init.c
921 --- httpd-2.0.52.org/modules/ssl/ssl_engine_init.c 2004-10-02 18:25:54.753485106 +0200
922 +++ httpd-2.0.52/modules/ssl/ssl_engine_init.c 2004-10-02 18:26:13.481473073 +0200
923 @@ -823,11 +823,11 @@
926 if (SSL_X509_getCN(ptemp, cert, &cn)) {
927 - int fnm_flags = FNM_PERIOD|FNM_CASE_BLIND;
928 + int fnm_flags = APR_FNM_PERIOD|APR_FNM_CASE_BLIND;
930 if (apr_fnmatch_test(cn) &&
931 (apr_fnmatch(cn, s->server_hostname,
932 - fnm_flags) == FNM_NOMATCH))
933 + fnm_flags) == APR_FNM_NOMATCH))
935 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s,
936 "%s server certificate wildcard CommonName (CN) `%s' "
937 diff -ur httpd-2.0.52.org/modules/ssl/ssl_scache_dbm.c httpd-2.0.52/modules/ssl/ssl_scache_dbm.c
938 --- httpd-2.0.52.org/modules/ssl/ssl_scache_dbm.c 2004-10-02 18:25:54.752485320 +0200
939 +++ httpd-2.0.52/modules/ssl/ssl_scache_dbm.c 2004-10-02 18:26:13.509467076 +0200
941 SSLModConfigRec *mc = myModConfig(s);
944 - apr_pool_sub_make(&p, mc->pPool, NULL);
945 + apr_pool_create_ex(&p, mc->pPool, NULL, NULL);
947 /* the correct way */
948 unlink(apr_pstrcat(p, mc->szSessionCacheDataFile, SSL_DBM_FILE_SUFFIX_DIR, NULL));
952 /* allocate the key array in a memory sub pool */
953 - apr_pool_sub_make(&p, mc->pPool, NULL);
954 + apr_pool_create_ex(&p, mc->pPool, NULL, NULL);
957 if ((keylist = apr_palloc(p, sizeof(dbmkey)*KEYMAX)) == NULL) {
958 diff -ur httpd-2.0.52.org/os/unix/unixd.c httpd-2.0.52/os/unix/unixd.c
959 --- httpd-2.0.52.org/os/unix/unixd.c 2004-10-02 18:25:57.168967645 +0200
960 +++ httpd-2.0.52/os/unix/unixd.c 2004-10-02 18:26:13.513466220 +0200
965 - status = apr_accept(&csd, lr->sd, ptrans);
966 + status = apr_socket_accept(&csd, lr->sd, ptrans);
967 if (status == APR_SUCCESS) {
970 diff -ur httpd-2.0.52.org/server/config.c httpd-2.0.52/server/config.c
971 --- httpd-2.0.52.org/server/config.c 2004-10-02 18:25:57.290941515 +0200
972 +++ httpd-2.0.52/server/config.c 2004-10-02 18:26:13.518465149 +0200
973 @@ -1546,7 +1546,7 @@
974 && !(strcmp(fname, ap_server_root_relative(p, SERVER_CONFIG_FILE)))) {
977 - if (apr_lstat(&finfo, fname, APR_FINFO_TYPE, p) != APR_SUCCESS)
978 + if (apr_stat(&finfo, fname, APR_FINFO_TYPE | APR_FINFO_LINK, p) != APR_SUCCESS)
982 @@ -1605,7 +1605,7 @@
983 if (strcmp(dirent.name, ".")
984 && strcmp(dirent.name, "..")
985 && (apr_fnmatch(pattern, dirent.name,
986 - FNM_PERIOD) == APR_SUCCESS)) {
987 + APR_FNM_PERIOD) == APR_SUCCESS)) {
988 fnew = (fnames *) apr_array_push(candidates);
989 fnew->fname = ap_make_full_path(p, path, dirent.name);
991 diff -ur httpd-2.0.52.org/server/connection.c httpd-2.0.52/server/connection.c
992 --- httpd-2.0.52.org/server/connection.c 2004-10-02 18:25:57.286942372 +0200
993 +++ httpd-2.0.52/server/connection.c 2004-10-02 18:26:13.520464720 +0200
995 /* Shut down the socket for write, which will send a FIN
998 - if (apr_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS
999 + if (apr_socket_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS
1001 apr_socket_close(csd);
1004 apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1);
1006 nbytes = sizeof(dummybuf);
1007 - rc = apr_recv(csd, dummybuf, &nbytes);
1008 + rc = apr_socket_recv(csd, dummybuf, &nbytes);
1009 if (rc != APR_SUCCESS || nbytes == 0)
1012 diff -ur httpd-2.0.52.org/server/core.c httpd-2.0.52/server/core.c
1013 --- httpd-2.0.52.org/server/core.c 2004-10-02 18:25:57.303938731 +0200
1014 +++ httpd-2.0.52/server/core.c 2004-10-02 18:26:13.531462364 +0200
1015 @@ -2916,7 +2916,7 @@
1017 /* XXX handle checking for non-blocking socket */
1018 while (bytes_written != len) {
1019 - rv = apr_sendv(s, vec + i, nvec - i, &n);
1020 + rv = apr_socket_sendv(s, vec + i, nvec - i, &n);
1022 if (rv != APR_SUCCESS)
1024 @@ -2924,7 +2924,7 @@
1027 /* If the write did not complete, adjust the iovecs and issue
1029 + * apr_socket_sendv again
1031 if (bytes_written < len) {
1032 /* Skip over the vectors that have already been written */
1033 @@ -2979,7 +2979,7 @@
1035 apr_size_t tmplen = file_bytes_left;
1037 - rv = apr_sendfile(c->client_socket, fd, hdtr, &file_offset, &tmplen,
1038 + rv = apr_socket_sendfile(c->client_socket, fd, hdtr, &file_offset, &tmplen,
1040 *bytes_sent += tmplen;
1041 total_bytes_left -= tmplen;
1042 @@ -3090,7 +3090,7 @@
1043 rv = apr_file_read(fd, buffer, &sendlen);
1044 while (rv == APR_SUCCESS && sendlen) {
1045 bytes_sent = sendlen;
1046 - rv = apr_send(c->client_socket, &buffer[o], &bytes_sent);
1047 + rv = apr_socket_send(c->client_socket, &buffer[o], &bytes_sent);
1048 if (rv == APR_SUCCESS) {
1049 sendlen -= bytes_sent; /* sendlen != bytes_sent ==> partial write */
1050 o += bytes_sent; /* o is where we are in the buffer */
1051 @@ -3873,7 +3873,7 @@
1053 else if (mode == AP_MODE_SPECULATIVE) {
1054 apr_bucket *copy_bucket;
1055 - APR_BRIGADE_FOREACH(e, ctx->b) {
1056 + for(e = APR_BRIGADE_FIRST(ctx->b); e != APR_BRIGADE_SENTINEL(ctx->b); e = APR_BUCKET_NEXT(e)) {
1057 rv = apr_bucket_copy(e, ©_bucket);
1058 if (rv != APR_SUCCESS) {
1060 @@ -3948,7 +3948,7 @@
1063 /* Iterate over the brigade: collect iovecs and/or a file */
1064 - APR_BRIGADE_FOREACH(e, b) {
1065 + for(e = APR_BRIGADE_FIRST(b); e != APR_BRIGADE_SENTINEL(b); e = APR_BUCKET_NEXT(e)) {
1066 /* keep track of the last bucket processed */
1068 if (APR_BUCKET_IS_EOS(e) || AP_BUCKET_IS_EOC(e)) {
1069 @@ -4212,7 +4212,7 @@
1071 &bytes_sent, /* how many bytes were
1073 - flags); /* apr_sendfile flags */
1074 + flags); /* apr_socket_sendfile flags */
1076 if (logio_add_bytes_out && bytes_sent > 0)
1077 logio_add_bytes_out(c, bytes_sent);
1078 diff -ur httpd-2.0.52.org/server/listen.c httpd-2.0.52/server/listen.c
1079 --- httpd-2.0.52.org/server/listen.c 2004-10-02 18:25:57.304938516 +0200
1080 +++ httpd-2.0.52/server/listen.c 2004-10-02 18:26:13.670432593 +0200
1082 ap_sock_disable_nagle(s);
1085 - if ((stat = apr_bind(s, server->bind_addr)) != APR_SUCCESS) {
1086 + if ((stat = apr_socket_bind(s, server->bind_addr)) != APR_SUCCESS) {
1087 ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, stat, p,
1088 "make_sock: could not bind to address %pI",
1094 - if ((stat = apr_listen(s, ap_listenbacklog)) != APR_SUCCESS) {
1095 + if ((stat = apr_socket_listen(s, ap_listenbacklog)) != APR_SUCCESS) {
1096 ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_ERR, stat, p,
1097 "make_sock: unable to listen for connections "
1099 @@ -213,10 +213,10 @@
1100 apr_socket_t *tmp_sock;
1103 - if ((sock_rv = apr_socket_create(&tmp_sock, APR_INET6, SOCK_STREAM, p))
1104 + if ((sock_rv = apr_socket_create(&tmp_sock, APR_INET6, SOCK_STREAM, APR_PROTO_TCP, p))
1106 apr_sockaddr_info_get(&sa, NULL, APR_INET6, 0, 0, p) == APR_SUCCESS &&
1107 - apr_bind(tmp_sock, sa) == APR_SUCCESS) {
1108 + apr_socket_bind(tmp_sock, sa) == APR_SUCCESS) {
1109 default_family = APR_INET6;
1113 sa = (*walk)->bind_addr;
1114 /* Some listeners are not real so they will not have a bind_addr. */
1116 - apr_sockaddr_port_get(&oldport, sa);
1117 + oldport = sa->port;
1118 if (!strcmp(sa->hostname, addr) && port == oldport) {
1119 /* re-use existing record */
1123 if ((status = apr_socket_create(&new->sd,
1124 new->bind_addr->family,
1125 - SOCK_STREAM, process->pool))
1126 + SOCK_STREAM, APR_PROTO_TCP, process->pool))
1128 ap_log_perror(APLOG_MARK, APLOG_CRIT, status, process->pool,
1129 "alloc_listener: failed to get a socket for %s", addr);
1130 diff -ur httpd-2.0.52.org/server/main.c httpd-2.0.52/server/main.c
1131 --- httpd-2.0.52.org/server/main.c 2004-10-02 18:25:57.292941087 +0200
1132 +++ httpd-2.0.52/server/main.c 2004-10-02 18:26:13.673431951 +0200
1134 apr_pool_tag(process->pconf, "pconf");
1135 process->argc = argc;
1136 process->argv = argv;
1137 - process->short_name = apr_filename_of_pathname(argv[0]);
1138 + process->short_name = apr_filepath_name_get(argv[0]);
1142 diff -ur httpd-2.0.52.org/server/mpm/experimental/metuxmpm/metuxmpm.c httpd-2.0.52/server/mpm/experimental/metuxmpm/metuxmpm.c
1143 --- httpd-2.0.52.org/server/mpm/experimental/metuxmpm/metuxmpm.c 2004-10-02 18:25:57.241952010 +0200
1144 +++ httpd-2.0.52/server/mpm/experimental/metuxmpm/metuxmpm.c 2004-10-02 18:26:13.678430880 +0200
1146 if (workers_may_exit) return APR_SUCCESS;
1148 apr_thread_mutex_lock(pipe_of_death_mutex);
1149 - ret = apr_recv(lr->sd, &pipe_read_char, &n);
1150 + ret = apr_socket_recv(lr->sd, &pipe_read_char, &n);
1151 if (APR_STATUS_IS_EAGAIN(ret))
1153 /* It lost the lottery. It must continue to suffer
1155 while (!workers_may_exit)
1160 _DBG("loop. conn_id=%d req_max=%d req_remain=%d",
1161 conn_id, ap_max_requests_per_child, requests_this_child);
1162 @@ -993,14 +994,18 @@
1164 /* -- setup pollset -- */
1165 /* NOTE: we do _not_ do this upwards anylonger */
1166 - apr_poll_setup(&pollset, num_listensocks, tpool);
1167 - apr_poll_setup(&pollset, num_listensocks, ptrans);
1168 + pollset = apr_pcalloc(ptrans, sizeof(apr_pollfd_t) * num_listensocks);
1170 for(lr_walk = ap_listeners; lr_walk != NULL; lr_walk = lr_walk->next)
1173 - apr_poll_socket_add(pollset, lr_walk->sd, APR_POLLIN);
1174 + pollset[ifd].p = ptrans;
1175 + pollset[ifd].desc.s = lr_walk->sd;
1176 + pollset[ifd].desc_type = APR_POLL_SOCKET;
1177 + pollset[ifd].reqevents = APR_POLLIN;
1178 apr_os_sock_get(&fd, lr_walk->sd);
1179 _DBG("adding fd %d to pollset", fd);
1183 if (workers_may_exit) goto worker_out;
1184 @@ -1032,10 +1037,13 @@
1185 _DBG("looking for an listener",0);
1186 for (lr_walk=ap_listeners; lr_walk!=NULL; lr_walk = lr_walk->next)
1190 apr_os_sock_get(&fd_tmp, lr_walk->sd);
1191 _DBG(" ... trying w/ fd=%d", fd_tmp);
1192 - apr_poll_revents_get(&event, lr_walk->sd, pollset);
1193 + for(fdt = 0; fdt < num_listensocks; fdt++)
1194 + if(pollset[fdt].desc.s == lr_walk->sd)
1196 + event = pollset[fdt].rtnevents;
1197 if (event & (APR_POLLIN))
1199 THREAD_ACCEPT_UNLOCK;
1200 @@ -1588,7 +1596,7 @@
1202 #if APR_HAS_OTHER_CHILD
1204 - else if (apr_proc_other_child_read(&pid, status) == 0)
1205 + else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH, status) == 0)
1209 diff -ur httpd-2.0.52.org/server/mpm/experimental/perchild/perchild.c httpd-2.0.52/server/mpm/experimental/perchild/perchild.c
1210 --- httpd-2.0.52.org/server/mpm/experimental/perchild/perchild.c 2004-10-02 18:25:57.234953509 +0200
1211 +++ httpd-2.0.52/server/mpm/experimental/perchild/perchild.c 2004-10-02 18:26:13.682430023 +0200
1213 char pipe_read_char;
1216 - ret = apr_recv(lr->sd, &pipe_read_char, &n);
1217 + ret = apr_socket_recv(lr->sd, &pipe_read_char, &n);
1218 if (APR_STATUS_IS_EAGAIN(ret)) {
1219 /* It lost the lottery. It must continue to suffer
1220 * through a life of servitude. */
1222 apr_pollfd_t *pollset;
1224 ap_listen_rec *lr, *last_lr = ap_listeners;
1227 apr_bucket_alloc_t *bucket_alloc;
1229 apr_thread_mutex_lock(thread_pool_parent_mutex);
1230 @@ -657,10 +657,15 @@
1232 bucket_alloc = apr_bucket_alloc_create(apr_thread_pool_get(thd));
1234 - apr_poll_setup(&pollset, num_listensocks, tpool);
1235 + pollset = apr_pcalloc(tpool, sizeof(apr_pollfd_t) * num_listensocks);
1237 for(lr = ap_listeners; lr != NULL; lr = lr->next) {
1239 - apr_poll_socket_add(pollset, lr->sd, APR_POLLIN);
1240 + pollset[ifd].p = tpool;
1241 + pollset[ifd].desc.s = lr->sd;
1242 + pollset[ifd].desc_type = APR_POLL_SOCKET;
1243 + pollset[ifd].reqevents = APR_POLLIN;
1246 apr_os_sock_get(&fd, lr->sd);
1248 @@ -726,7 +731,10 @@
1251 /* XXX: Should we check for POLLERR? */
1252 - apr_poll_revents_get(&event, lr->sd, pollset);
1253 + for(ifd = 0; ifd < num_listensocks; ifd++)
1254 + if(pollset[ifd].desc.s == lr->sd)
1256 + event = pollset[ifd].rtnevents;
1257 if (event & (APR_POLLIN)) {
1260 @@ -1170,7 +1178,7 @@
1262 #if APR_HAS_OTHER_CHILD
1264 - else if (apr_proc_other_child_read(&pid, status) == 0) {
1265 + else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH, status) == 0) {
1269 diff -ur httpd-2.0.52.org/server/mpm/experimental/peruser/peruser.c httpd-2.0.52/server/mpm/experimental/peruser/peruser.c
1270 --- httpd-2.0.52.org/server/mpm/experimental/peruser/peruser.c 2004-10-02 18:25:57.245951153 +0200
1271 +++ httpd-2.0.52/server/mpm/experimental/peruser/peruser.c 2004-10-02 18:26:13.687428952 +0200
1273 if (die_now) return APR_SUCCESS;
1275 /* apr_thread_mutex_lock(pipe_of_death_mutex); */
1276 - ret = apr_recv(lr->sd, &pipe_read_char, &n);
1277 + ret = apr_socket_recv(lr->sd, &pipe_read_char, &n);
1278 if (APR_STATUS_IS_EAGAIN(ret))
1280 /* It lost the lottery. It must continue to suffer
1281 @@ -1985,7 +1985,7 @@
1283 #if APR_HAS_OTHER_CHILD
1285 - else if (apr_proc_other_child_read(&pid, status) == 0) {
1286 + else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH, status) == 0) {
1287 _DBG("APR_HAS_OTHER_CHILD, apparently", 0);
1290 diff -ur httpd-2.0.52.org/server/mpm/prefork/prefork.c httpd-2.0.52/server/mpm/prefork/prefork.c
1291 --- httpd-2.0.52.org/server/mpm/prefork/prefork.c 2004-10-02 18:25:57.273945156 +0200
1292 +++ httpd-2.0.52/server/mpm/prefork/prefork.c 2004-10-02 18:26:13.691428095 +0200
1293 @@ -1002,7 +1002,7 @@
1295 #if APR_HAS_OTHER_CHILD
1297 - else if (apr_proc_other_child_read(&pid, status) == 0) {
1298 + else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH, status) == 0) {
1302 diff -ur httpd-2.0.52.org/server/mpm/worker/pod.c httpd-2.0.52/server/mpm/worker/pod.c
1303 --- httpd-2.0.52.org/server/mpm/worker/pod.c 2004-10-02 18:25:57.245951153 +0200
1304 +++ httpd-2.0.52/server/mpm/worker/pod.c 2004-10-02 18:26:13.693427667 +0200
1308 /* close these before exec. */
1309 - apr_file_unset_inherit((*pod)->pod_in);
1310 - apr_file_unset_inherit((*pod)->pod_out);
1311 + apr_file_inherit_unset((*pod)->pod_in);
1312 + apr_file_inherit_unset((*pod)->pod_out);
1316 diff -ur httpd-2.0.52.org/server/mpm/worker/worker.c httpd-2.0.52/server/mpm/worker/worker.c
1317 --- httpd-2.0.52.org/server/mpm/worker/worker.c 2004-10-02 18:25:57.269946013 +0200
1318 +++ httpd-2.0.52/server/mpm/worker/worker.c 2004-10-02 18:26:13.697426810 +0200
1319 @@ -578,13 +578,19 @@
1320 apr_pollfd_t *pollset;
1322 ap_listen_rec *lr, *last_lr = ap_listeners;
1323 - int have_idle_worker = 0;
1324 + int have_idle_worker = 0, ifd;
1328 - apr_poll_setup(&pollset, num_listensocks, tpool);
1329 - for(lr = ap_listeners ; lr != NULL ; lr = lr->next)
1330 - apr_poll_socket_add(pollset, lr->sd, APR_POLLIN);
1331 + pollset = apr_pcalloc(tpool, sizeof(apr_pollfd_t) * num_listensocks);
1333 + for(lr = ap_listeners ; lr != NULL ; lr = lr->next) {
1334 + pollset[ifd].p = tpool;
1335 + pollset[ifd].desc.s = lr->sd;
1336 + pollset[ifd].desc_type = APR_POLL_SOCKET;
1337 + pollset[ifd].reqevents = APR_POLLIN;
1341 /* Unblock the signal used to wake this thread up, and set a handler for
1343 @@ -670,7 +676,10 @@
1346 /* XXX: Should we check for POLLERR? */
1347 - apr_poll_revents_get(&event, lr->sd, pollset);
1348 + for(ifd = 0; ifd < num_listensocks; ifd++)
1349 + if(pollset[ifd].desc.s == lr->sd)
1351 + event = pollset[ifd].rtnevents;
1352 if (event & APR_POLLIN) {
1355 @@ -1500,7 +1509,7 @@
1357 #if APR_HAS_OTHER_CHILD
1359 - else if (apr_proc_other_child_read(&pid, status) == 0) {
1360 + else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH, status) == 0) {
1364 diff -ur httpd-2.0.52.org/server/protocol.c httpd-2.0.52/server/protocol.c
1365 --- httpd-2.0.52.org/server/protocol.c 2004-10-02 18:25:57.276944514 +0200
1366 +++ httpd-2.0.52/server/protocol.c 2004-10-02 18:26:13.704425311 +0200
1368 return APR_EGENERAL;
1371 - APR_BRIGADE_FOREACH(e, bb) {
1372 + for(e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) {
1376 diff -ur httpd-2.0.52.org/server/request.c httpd-2.0.52/server/request.c
1377 --- httpd-2.0.52.org/server/request.c 2004-10-02 18:25:57.281943443 +0200
1378 +++ httpd-2.0.52/server/request.c 2004-10-02 18:26:13.709424240 +0200
1380 * owner of the symlink, then get the info of the target.
1382 if (!(lfi->valid & APR_FINFO_OWNER)) {
1383 - if ((res = apr_lstat(&fi, d, lfi->valid | APR_FINFO_OWNER, p))
1384 + if ((res = apr_stat(&fi, d, lfi->valid | APR_FINFO_OWNER | APR_FINFO_LINK, p))
1386 return HTTP_FORBIDDEN;
1389 return HTTP_FORBIDDEN;
1392 - if (apr_compare_users(fi.user, lfi->user) != APR_SUCCESS) {
1393 + if (apr_uid_compare(fi.user, lfi->user) != APR_SUCCESS) {
1394 return HTTP_FORBIDDEN;
1398 && ((entry_core->d_components < seg)
1399 || (entry_core->d_is_fnmatch
1400 ? (apr_fnmatch(entry_core->d, r->filename,
1401 - FNM_PATHNAME) != APR_SUCCESS)
1402 + APR_FNM_PATHNAME) != APR_SUCCESS)
1403 : (strcmp(r->filename, entry_core->d) != 0)))) {
1407 * want the name of this 'link' object, not the name of its
1408 * target, if we are fixing the filename case/resolving aliases.
1410 - rv = apr_lstat(&thisinfo, r->filename,
1411 - APR_FINFO_MIN | APR_FINFO_NAME, r->pool);
1412 + rv = apr_stat(&thisinfo, r->filename,
1413 + APR_FINFO_MIN | APR_FINFO_NAME | APR_FINFO_LINK, r->pool);
1415 if (APR_STATUS_IS_ENOENT(rv)) {
1416 /* Nothing? That could be nice. But our directory
1417 @@ -1230,7 +1230,7 @@
1419 ? ap_regexec(entry_core->r, r->uri, 0, NULL, 0)
1420 : (entry_core->d_is_fnmatch
1421 - ? apr_fnmatch(entry_core->d, cache->cached, FNM_PATHNAME)
1422 + ? apr_fnmatch(entry_core->d, cache->cached, APR_FNM_PATHNAME)
1423 : (strncmp(entry_core->d, cache->cached, len)
1424 || (entry_core->d[len - 1] != '/'
1425 && cache->cached[len] != '/'
1426 @@ -1379,7 +1379,7 @@
1428 ? ap_regexec(entry_core->r, cache->cached , 0, NULL, 0)
1429 : (entry_core->d_is_fnmatch
1430 - ? apr_fnmatch(entry_core->d, cache->cached, FNM_PATHNAME)
1431 + ? apr_fnmatch(entry_core->d, cache->cached, APR_FNM_PATHNAME)
1432 : strcmp(entry_core->d, cache->cached))) {
1435 @@ -1690,8 +1690,8 @@
1439 - if (((rv = apr_lstat(&rnew->finfo, rnew->filename,
1440 - APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS)
1441 + if (((rv = apr_stat(&rnew->finfo, rnew->filename,
1442 + APR_FINFO_MIN | APR_FINFO_LINK, rnew->pool)) != APR_SUCCESS)
1443 && (rv != APR_INCOMPLETE)) {
1444 rnew->finfo.filetype = 0;
1446 @@ -1795,8 +1795,8 @@
1450 - if (((rv = apr_lstat(&rnew->finfo, rnew->filename,
1451 - APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS)
1452 + if (((rv = apr_stat(&rnew->finfo, rnew->filename,
1453 + APR_FINFO_MIN | APR_FINFO_LINK, rnew->pool)) != APR_SUCCESS)
1454 && (rv != APR_INCOMPLETE)) {
1455 rnew->finfo.filetype = 0;
1457 diff -ur httpd-2.0.52.org/server/rfc1413.c httpd-2.0.52/server/rfc1413.c
1458 --- httpd-2.0.52.org/server/rfc1413.c 2004-10-02 18:25:57.274944942 +0200
1459 +++ httpd-2.0.52/server/rfc1413.c 2004-10-02 18:26:13.712423598 +0200
1462 if ((rv = apr_socket_create(newsock,
1463 localsa->family, /* has to match */
1464 - SOCK_STREAM, conn->pool)) != APR_SUCCESS) {
1465 + SOCK_STREAM, APR_PROTO_TCP, conn->pool)) != APR_SUCCESS) {
1466 ap_log_error(APLOG_MARK, APLOG_CRIT, rv, srv,
1467 "rfc1413: error creating query socket");
1470 * addresses from the query socket.
1473 - if ((rv = apr_bind(*newsock, localsa)) != APR_SUCCESS) {
1474 + if ((rv = apr_socket_bind(*newsock, localsa)) != APR_SUCCESS) {
1475 ap_log_error(APLOG_MARK, APLOG_CRIT, rv, srv,
1476 "rfc1413: Error binding query socket to local port");
1477 apr_socket_close(*newsock);
1479 * errors from connect usually imply the remote machine doesn't support
1480 * the service; don't log such an error
1482 - if ((rv = apr_connect(*newsock, destsa)) != APR_SUCCESS) {
1483 + if ((rv = apr_socket_connect(*newsock, destsa)) != APR_SUCCESS) {
1484 apr_socket_close(*newsock);
1488 char user[RFC1413_USERLEN + 1]; /* XXX */
1491 - apr_sockaddr_port_get(&sav_our_port, conn->local_addr);
1492 - apr_sockaddr_port_get(&sav_rmt_port, conn->remote_addr);
1493 + sav_our_port = conn->local_addr->port;
1494 + sav_rmt_port = conn->remote_addr->port;
1497 buflen = apr_snprintf(buffer, sizeof(buffer), "%hu,%hu\r\n", sav_rmt_port,
1499 while (i < buflen) {
1500 apr_size_t j = strlen(buffer + i);
1501 apr_status_t status;
1502 - status = apr_send(sock, buffer+i, &j);
1503 + status = apr_socket_send(sock, buffer+i, &j);
1504 if (status != APR_SUCCESS) {
1505 ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
1506 "write: rfc1413: error sending request");
1508 while((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) {
1509 apr_size_t j = sizeof(buffer) - 1 - i;
1510 apr_status_t status;
1511 - status = apr_recv(sock, buffer+i, &j);
1512 + status = apr_socket_recv(sock, buffer+i, &j);
1513 if (status != APR_SUCCESS) {
1514 ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
1515 "read: rfc1413: error reading response");
1516 diff -ur httpd-2.0.52.org/server/util.c httpd-2.0.52/server/util.c
1517 --- httpd-2.0.52.org/server/util.c 2004-10-02 18:25:57.284942800 +0200
1518 +++ httpd-2.0.52/server/util.c 2004-10-02 18:26:13.716422741 +0200
1519 @@ -1916,7 +1916,7 @@
1523 - if (apr_lstat(&finfo, path, APR_FINFO_TYPE, p) != APR_SUCCESS)
1524 + if (apr_stat(&finfo, path, APR_FINFO_TYPE | APR_FINFO_LINK, p) != APR_SUCCESS)
1525 return 0; /* in error condition, just return no */
1527 return (finfo.filetype == APR_DIR);
1528 diff -ur httpd-2.0.52.org/server/util_filter.c httpd-2.0.52/server/util_filter.c
1529 --- httpd-2.0.52.org/server/util_filter.c 2004-10-02 18:25:57.280943657 +0200
1530 +++ httpd-2.0.52/server/util_filter.c 2004-10-02 18:26:13.719422098 +0200
1532 *saveto = apr_brigade_create(p, f->c->bucket_alloc);
1535 - APR_RING_FOREACH(e, &(*b)->list, apr_bucket, link) {
1536 + for(e = APR_RING_FIRST(&(*b)->list); e != APR_RING_SENTINEL(&(*b)->list, apr_bucket, link); e = APR_RING_NEXT(e, link)) {
1537 rv = apr_bucket_setaside(e, p);
1538 if (rv != APR_SUCCESS
1539 /* ### this ENOTIMPL will go away once we implement setaside
1540 diff -ur httpd-2.0.52.org/server/util_md5.c httpd-2.0.52/server/util_md5.c
1541 --- httpd-2.0.52.org/server/util_md5.c 2004-10-02 18:25:57.294940658 +0200
1542 +++ httpd-2.0.52/server/util_md5.c 2004-10-02 18:26:13.721421670 +0200
1545 const char *hex = "0123456789abcdef";
1546 apr_md5_ctx_t my_md5;
1547 - unsigned char hash[MD5_DIGESTSIZE];
1548 - char *r, result[33]; /* (MD5_DIGESTSIZE * 2) + 1 */
1549 + unsigned char hash[APR_MD5_DIGESTSIZE];
1550 + char *r, result[33]; /* (APR_MD5_DIGESTSIZE * 2) + 1 */
1555 apr_md5_update(&my_md5, buf, (unsigned int)length);
1556 apr_md5_final(hash, &my_md5);
1558 - for (i = 0, r = result; i < MD5_DIGESTSIZE; i++) {
1559 + for (i = 0, r = result; i < APR_MD5_DIGESTSIZE; i++) {
1560 *r++ = hex[hash[i] >> 4];
1561 *r++ = hex[hash[i] & 0xF];
1565 - return apr_pstrndup(p, result, MD5_DIGESTSIZE*2);
1566 + return apr_pstrndup(p, result, APR_MD5_DIGESTSIZE*2);
1569 AP_DECLARE(char *) ap_md5(apr_pool_t *p, const unsigned char *string)
1570 diff -ur httpd-2.0.52.org/server/util_script.c httpd-2.0.52/server/util_script.c
1571 --- httpd-2.0.52.org/server/util_script.c 2004-10-02 18:25:57.291941301 +0200
1572 +++ httpd-2.0.52/server/util_script.c 2004-10-02 18:26:13.812402180 +0200
1574 apr_table_addn(e, "SERVER_ADMIN", s->server_admin); /* Apache */
1575 apr_table_addn(e, "SCRIPT_FILENAME", r->filename); /* Apache */
1577 - apr_sockaddr_port_get(&rport, c->remote_addr);
1578 + rport = c->remote_addr->port;
1579 apr_table_addn(e, "REMOTE_PORT", apr_itoa(r->pool, rport));
1583 if ((*getsfunc) (w, MAX_STRING_LEN - 1, getsfunc_data) == 0) {
1584 ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, 0, r,
1585 "Premature end of script headers: %s",
1586 - apr_filename_of_pathname(r->filename));
1587 + apr_filepath_name_get(r->filename));
1588 return HTTP_INTERNAL_SERVER_ERROR;
1593 ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, 0, r,
1594 "%s: %s", malformed,
1595 - apr_filename_of_pathname(r->filename));
1596 + apr_filepath_name_get(r->filename));
1597 return HTTP_INTERNAL_SERVER_ERROR;
1602 rv = apr_bucket_read(e, &bucket_data, &bucket_data_len,
1604 - if (!APR_STATUS_IS_SUCCESS(rv) || (bucket_data_len == 0)) {
1605 + if ((rv != APR_SUCCESS) || (bucket_data_len == 0)) {
1609 diff -ur httpd-2.0.52.org/server/util_time.c httpd-2.0.52/server/util_time.c
1610 --- httpd-2.0.52.org/server/util_time.c 2004-10-02 18:25:57.282943228 +0200
1611 +++ httpd-2.0.52/server/util_time.c 2004-10-02 18:26:13.814401751 +0200
1614 r = apr_time_exp_lt(xt, t);
1616 - if (!APR_STATUS_IS_SUCCESS(r)) {
1617 + if (r != APR_SUCCESS) {
1620 cache_element->t = seconds;
1621 diff -ur httpd-2.0.52.org/server/util_xml.c httpd-2.0.52/server/util_xml.c
1622 --- httpd-2.0.52.org/server/util_xml.c 2004-10-02 18:25:57.283943014 +0200
1623 +++ httpd-2.0.52/server/util_xml.c 2004-10-02 18:26:13.817401109 +0200
1628 - APR_BRIGADE_FOREACH(bucket, brigade) {
1629 + for(bucket = APR_BRIGADE_FIRST(brigade); bucket != APR_BRIGADE_SENTINEL(brigade); bucket = APR_BUCKET_NEXT(bucket)) {
1633 diff -ur httpd-2.0.52.org/server/vhost.c httpd-2.0.52/server/vhost.c
1634 --- httpd-2.0.52.org/server/vhost.c 2004-10-02 18:25:57.285942586 +0200
1635 +++ httpd-2.0.52/server/vhost.c 2004-10-02 18:26:13.883386973 +0200
1640 - apr_sockaddr_port_get(&port, r->connection->local_addr);
1641 + port = r->connection->local_addr->port;
1643 /* Recall that the name_chain is a list of server_addr_recs, some of
1644 * whose ports may not match. Also each server may appear more than
1649 - apr_sockaddr_port_get(&port, r->connection->local_addr);
1650 + port = r->connection->local_addr->port;
1653 * This is in conjunction with the ServerPath code in http_core, so we
1654 @@ -1004,7 +1004,7 @@
1655 /* maybe there's a default server or wildcard name-based vhost
1656 * matching this port
1658 - apr_sockaddr_port_get(&port, conn->local_addr);
1659 + port = conn->local_addr->port;
1661 trav = find_default_server(port);
1663 diff -ur httpd-2.0.52.org/support/ab.c httpd-2.0.52/support/ab.c
1664 --- httpd-2.0.52.org/support/ab.c 2004-10-02 18:25:58.481686426 +0200
1665 +++ httpd-2.0.52/support/ab.c 2004-10-02 18:26:13.888385902 +0200
1670 - e = apr_send(c->aprsock, request + c->rwrote, &l);
1671 + e = apr_socket_send(c->aprsock, request + c->rwrote, &l);
1674 * Bail early on the most common case
1675 @@ -1204,7 +1204,7 @@
1676 apr_pool_create(&c->ctx, cntxt);
1678 if ((rv = apr_socket_create(&c->aprsock, destsa->family,
1679 - SOCK_STREAM, c->ctx)) != APR_SUCCESS) {
1680 + SOCK_STREAM, APR_PROTO_TCP, c->ctx)) != APR_SUCCESS) {
1681 apr_err("socket", rv);
1683 if ((rv = apr_socket_opt_set(c->aprsock, APR_SO_NONBLOCK, 1))
1684 @@ -1212,7 +1212,7 @@
1685 apr_err("socket nonblock", rv);
1687 c->start = apr_time_now();
1688 - if ((rv = apr_connect(c->aprsock, destsa)) != APR_SUCCESS) {
1689 + if ((rv = apr_socket_connect(c->aprsock, destsa)) != APR_SUCCESS) {
1690 if (APR_STATUS_IS_EINPROGRESS(rv)) {
1691 apr_pollfd_t new_pollfd;
1692 c->state = STATE_CONNECTING;
1693 @@ -1234,7 +1234,7 @@
1696 "\nTest aborted after 10 failures\n\n");
1697 - apr_err("apr_connect()", rv);
1698 + apr_err("apr_socket_connect()", rv);
1700 c->state = STATE_UNCONNECTED;
1702 @@ -1334,7 +1334,7 @@
1706 - status = apr_recv(c->aprsock, buffer, &r);
1707 + status = apr_socket_recv(c->aprsock, buffer, &r);
1708 if (APR_STATUS_IS_EAGAIN(status))
1710 else if (r == 0 && APR_STATUS_IS_EOF(status)) {
1711 @@ -1342,12 +1342,12 @@
1712 close_connection(c);
1715 - /* catch legitimate fatal apr_recv errors */
1716 + /* catch legitimate fatal apr_socket_recv errors */
1717 else if (status != APR_SUCCESS) {
1718 err_except++; /* XXX: is this the right error counter? */
1719 /* XXX: Should errors here be fatal, or should we allow a
1720 * certain number of them before completely failing? -aaron */
1721 - apr_err("apr_recv", status);
1722 + apr_err("apr_socket_recv", status);
1726 @@ -1708,7 +1708,7 @@
1727 if (rv & APR_POLLOUT) {
1728 if (c->state == STATE_CONNECTING) {
1729 apr_pollfd_t remove_pollfd;
1730 - rv = apr_connect(c->aprsock, destsa);
1731 + rv = apr_socket_connect(c->aprsock, destsa);
1732 remove_pollfd.desc_type = APR_POLL_SOCKET;
1733 remove_pollfd.desc.s = c->aprsock;
1734 apr_pollset_remove(readbits, &remove_pollfd);
1735 @@ -1718,7 +1718,7 @@
1738 "\nTest aborted after 10 failures\n\n");
1739 - apr_err("apr_connect()", rv);
1740 + apr_err("apr_socket_connect()", rv);
1742 c->state = STATE_UNCONNECTED;
1744 diff -ur httpd-2.0.52.org/support/Makefile.in httpd-2.0.52/support/Makefile.in
1745 --- httpd-2.0.52.org/support/Makefile.in 2004-10-02 18:25:58.494683641 +0200
1746 +++ httpd-2.0.52/support/Makefile.in 2004-10-02 18:26:13.890385473 +0200
1751 - $(LINK) $(ab_LTFLAGS) $(ab_OBJECTS) $(PROGRAM_LDADD)
1752 + $(LINK) $(ab_LTFLAGS) $(ab_OBJECTS) $(PROGRAM_LDADD) -lm
1754 checkgid_OBJECTS = checkgid.lo
1755 checkgid: $(checkgid_OBJECTS)
1756 diff -ur httpd-2.0.52.org/modules/experimental/util_ldap.c httpd-2.0.52/modules/experimental/util_ldap.c
1757 --- httpd-2.0.52.org/modules/experimental/util_ldap.c 2004-10-02 22:10:30.732572635 +0200
1758 +++ httpd-2.0.52/modules/experimental/util_ldap.c 2004-10-03 00:59:18.141012892 +0200
1760 #error mod_ldap requires APR-util to have LDAP support built in
1763 +#define const_cast(x) (x)
1765 /* defines for certificate file types
1767 #define LDAP_CA_TYPE_UNKNOWN 0
1769 --- httpd-2.0.54/server/mpm_common.c 2005-03-30 09:42:15.000000000 +0000
1770 +++ httpd-2.0.54.new/server/mpm_common.c 2005-04-18 07:11:07.869583928 +0000
1774 #if APR_HAS_OTHER_CHILD
1775 - apr_proc_other_child_check();
1776 + apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART);
1779 } while (not_dead_yet > 0 &&
1783 /* close these before exec. */
1784 - apr_file_unset_inherit((*pod)->pod_in);
1785 - apr_file_unset_inherit((*pod)->pod_out);
1786 + apr_file_inherit_unset((*pod)->pod_in);
1787 + apr_file_inherit_unset((*pod)->pod_out);
1795 - rv = apr_socket_create(&sock, ap_listeners->bind_addr->family, SOCK_STREAM, p);
1796 + rv = apr_socket_create(&sock, ap_listeners->bind_addr->family, SOCK_STREAM, APR_PROTO_TCP, p);
1797 if (rv != APR_SUCCESS) {
1798 ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf,
1799 "get socket to connect to listener");
1804 - rv = apr_connect(sock, ap_listeners->bind_addr);
1805 + rv = apr_socket_connect(sock, ap_listeners->bind_addr);
1806 if (rv != APR_SUCCESS) {
1807 int log_level = APLOG_WARNING;