]>
Commit | Line | Data |
---|---|---|
fb7841c8 AM |
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-01 01:16:27.985755167 +0200 | |
3 | +++ httpd-2.0.52/include/ap_compat.h 2004-10-01 01:17:32.608911172 +0200 | |
4 | @@ -17,7 +17,6 @@ | |
5 | #define AP_COMPAT_H | |
fa0f2add | 6 | |
fb7841c8 AM |
7 | /* Drag in apu (and therefore apr) renamed symbols */ |
8 | -#include "apu_compat.h" | |
fa0f2add | 9 | |
fb7841c8 | 10 | /* redefine 1.3.x symbols to the new symbol names */ |
fa0f2add | 11 | |
fb7841c8 AM |
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-01 01:16:28.025746600 +0200 | |
14 | +++ httpd-2.0.52/include/util_ldap.h 2004-10-01 01:17:32.715888254 +0200 | |
15 | @@ -19,7 +19,7 @@ | |
16 | #include <apr_ldap.h> | |
fa0f2add | 17 | |
fb7841c8 AM |
18 | /* this whole thing disappears if LDAP is not enabled */ |
19 | -#ifdef APU_HAS_LDAP | |
20 | +#ifdef APR_HAS_LDAP | |
fa0f2add | 21 | |
fb7841c8 AM |
22 | /* APR header files */ |
23 | #include <apr_thread_mutex.h> | |
24 | Tylko w httpd-2.0.52: LOG | |
25 | diff -ur httpd-2.0.52.org/modules/aaa/mod_auth_digest.c httpd-2.0.52/modules/aaa/mod_auth_digest.c | |
26 | --- httpd-2.0.52.org/modules/aaa/mod_auth_digest.c 2004-10-01 01:16:28.227703335 +0200 | |
27 | +++ httpd-2.0.52/modules/aaa/mod_auth_digest.c 2004-10-01 01:17:32.626907316 +0200 | |
28 | @@ -119,7 +119,7 @@ | |
29 | unsigned long key; /* the key for this entry */ | |
30 | struct hash_entry *next; /* next entry in the bucket */ | |
31 | unsigned long nonce_count; /* for nonce-count checking */ | |
32 | - char ha1[2*MD5_DIGESTSIZE+1]; /* for algorithm=MD5-sess */ | |
33 | + char ha1[2*APR_MD5_DIGESTSIZE+1]; /* for algorithm=MD5-sess */ | |
34 | char last_nonce[NONCE_LEN+1]; /* for one-time nonce's */ | |
35 | } client_entry; | |
fa0f2add | 36 | |
fb7841c8 AM |
37 | diff -ur httpd-2.0.52.org/modules/cache/mod_file_cache.c httpd-2.0.52/modules/cache/mod_file_cache.c |
38 | --- httpd-2.0.52.org/modules/cache/mod_file_cache.c 2004-10-01 01:16:28.933552124 +0200 | |
39 | +++ httpd-2.0.52/modules/cache/mod_file_cache.c 2004-10-01 01:17:32.647902818 +0200 | |
40 | @@ -275,7 +275,7 @@ | |
41 | apr_mmap_t *mm; | |
42 | apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc); | |
fa0f2add | 43 | |
fb7841c8 AM |
44 | - apr_mmap_dup(&mm, file->mm, r->pool, 0); |
45 | + apr_mmap_dup(&mm, file->mm, r->pool); | |
46 | b = apr_bucket_mmap_create(mm, 0, (apr_size_t)file->finfo.size, | |
47 | c->bucket_alloc); | |
48 | APR_BRIGADE_INSERT_TAIL(bb, b); | |
49 | diff -ur httpd-2.0.52.org/modules/dav/fs/lock.c httpd-2.0.52/modules/dav/fs/lock.c | |
50 | --- httpd-2.0.52.org/modules/dav/fs/lock.c 2004-10-01 01:16:28.232702264 +0200 | |
51 | +++ httpd-2.0.52/modules/dav/fs/lock.c 2004-10-01 01:17:32.634905603 +0200 | |
52 | @@ -632,7 +632,7 @@ | |
53 | apr_status_t rv; | |
fa0f2add | 54 | |
fb7841c8 AM |
55 | /* if we don't see the file, then it's a locknull */ |
56 | - rv = apr_lstat(&finfo, fname, APR_FINFO_MIN, p); | |
57 | + rv = apr_stat(&finfo, fname, APR_FINFO_MIN | APR_FINFO_LINK, p); | |
58 | if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) { | |
59 | if ((err = dav_fs_remove_locknull_member(p, fname, &buf)) != NULL) { | |
60 | /* ### push a higher-level description? */ | |
61 | diff -ur httpd-2.0.52.org/modules/dav/fs/repos.c httpd-2.0.52/modules/dav/fs/repos.c | |
62 | --- httpd-2.0.52.org/modules/dav/fs/repos.c 2004-10-01 01:16:28.229702907 +0200 | |
63 | +++ httpd-2.0.52/modules/dav/fs/repos.c 2004-10-01 01:17:32.630906460 +0200 | |
64 | @@ -1453,8 +1453,8 @@ | |
fa0f2add | 65 | |
fa0f2add | 66 | |
fb7841c8 AM |
67 | /* ### Optimize me, dirent can give us what we need! */ |
68 | - status = apr_lstat(&fsctx->info1.finfo, fsctx->path1.buf, | |
69 | - APR_FINFO_NORM, pool); | |
70 | + status = apr_stat(&fsctx->info1.finfo, fsctx->path1.buf, | |
71 | + APR_FINFO_NORM | APR_FINFO_LINK, pool); | |
72 | if (status != APR_SUCCESS && status != APR_INCOMPLETE) { | |
73 | /* woah! where'd it go? */ | |
74 | /* ### should have a better error here */ | |
75 | diff -ur httpd-2.0.52.org/modules/dav/main/util.c httpd-2.0.52/modules/dav/main/util.c | |
76 | --- httpd-2.0.52.org/modules/dav/main/util.c 2004-10-01 01:16:28.239700765 +0200 | |
77 | +++ httpd-2.0.52/modules/dav/main/util.c 2004-10-01 01:17:32.638904746 +0200 | |
78 | @@ -213,7 +213,7 @@ | |
79 | /* now, verify that the URI uses the same scheme as the current. | |
80 | request. the port must match our port. | |
81 | */ | |
82 | - apr_sockaddr_port_get(&port, r->connection->local_addr); | |
83 | + port = r->connection->local_addr->port; | |
84 | if (strcasecmp(comp.scheme, scheme) != 0 | |
85 | #ifdef APACHE_PORT_HANDLING_IS_BUSTED | |
86 | || comp.port != port | |
87 | diff -ur httpd-2.0.52.org/modules/experimental/mod_auth_ldap.c httpd-2.0.52/modules/experimental/mod_auth_ldap.c | |
88 | --- httpd-2.0.52.org/modules/experimental/mod_auth_ldap.c 2004-10-01 01:16:29.419448032 +0200 | |
89 | +++ httpd-2.0.52/modules/experimental/mod_auth_ldap.c 2004-10-01 01:17:32.696892324 +0200 | |
90 | @@ -42,7 +42,7 @@ | |
91 | #include "http_request.h" | |
92 | #include "util_ldap.h" | |
fa0f2add | 93 | |
fb7841c8 AM |
94 | -#ifndef APU_HAS_LDAP |
95 | +#ifndef APR_HAS_LDAP | |
96 | #error mod_auth_ldap requires APR-util to have LDAP support built in | |
97 | #endif | |
fa0f2add | 98 | |
fb7841c8 | 99 | @@ -695,6 +695,7 @@ |
fa0f2add | 100 | { |
fb7841c8 AM |
101 | int result; |
102 | apr_ldap_url_desc_t *urld; | |
103 | + apr_ldap_err_t *reserr; | |
fa0f2add | 104 | |
fb7841c8 | 105 | mod_auth_ldap_config_t *sec = config; |
fa0f2add | 106 | |
fb7841c8 AM |
107 | @@ -702,16 +703,14 @@ |
108 | cmd->server, "[%d] auth_ldap url parse: `%s'", | |
109 | getpid(), url); | |
110 | ||
111 | - result = apr_ldap_url_parse(url, &(urld)); | |
112 | + result = apr_ldap_url_parse(cmd->pool, url, &(urld), &reserr); | |
113 | if (result != LDAP_SUCCESS) { | |
114 | switch (result) { | |
115 | - case LDAP_URL_ERR_NOTLDAP: | |
116 | + case APR_LDAP_URL_ERR_BADSCHEME: | |
117 | return "LDAP URL does not begin with ldap://"; | |
118 | - case LDAP_URL_ERR_NODN: | |
119 | - return "LDAP URL does not have a DN"; | |
120 | - case LDAP_URL_ERR_BADSCOPE: | |
121 | + case APR_LDAP_URL_ERR_BADSCOPE: | |
122 | return "LDAP URL has an invalid scope"; | |
123 | - case LDAP_URL_ERR_MEM: | |
124 | + case APR_LDAP_URL_ERR_MEM: | |
125 | return "Out of memory parsing LDAP URL"; | |
126 | default: | |
127 | return "Could not parse LDAP URL"; | |
128 | @@ -802,7 +801,6 @@ | |
fa0f2add | 129 | } |
fa0f2add | 130 | |
fb7841c8 AM |
131 | sec->have_ldap_url = 1; |
132 | - apr_ldap_free_urldesc(urld); | |
133 | return NULL; | |
fa0f2add JB |
134 | } |
135 | ||
fb7841c8 AM |
136 | diff -ur httpd-2.0.52.org/modules/experimental/mod_cache.h httpd-2.0.52/modules/experimental/mod_cache.h |
137 | --- httpd-2.0.52.org/modules/experimental/mod_cache.h 2004-10-01 01:16:29.349463025 +0200 | |
138 | +++ httpd-2.0.52/modules/experimental/mod_cache.h 2004-10-01 01:17:32.686894465 +0200 | |
139 | @@ -172,7 +172,7 @@ | |
140 | void *vobj; /* Opaque portion (specific to the cache implementation) of the cache object */ | |
141 | apr_size_t count; /* Number of body bytes written to the cache so far */ | |
142 | int complete; | |
143 | - apr_atomic_t refcount; | |
144 | + apr_uint32_t refcount; | |
145 | apr_size_t cleanup; | |
146 | }; | |
fa0f2add | 147 | |
fb7841c8 AM |
148 | diff -ur httpd-2.0.52.org/modules/experimental/mod_case_filter.c httpd-2.0.52/modules/experimental/mod_case_filter.c |
149 | --- httpd-2.0.52.org/modules/experimental/mod_case_filter.c 2004-10-01 01:16:29.423447175 +0200 | |
150 | +++ httpd-2.0.52/modules/experimental/mod_case_filter.c 2004-10-01 01:17:32.688894037 +0200 | |
151 | @@ -60,7 +60,7 @@ | |
152 | apr_bucket_brigade *pbbOut; | |
fa0f2add | 153 | |
fb7841c8 AM |
154 | pbbOut=apr_brigade_create(r->pool, c->bucket_alloc); |
155 | - APR_BRIGADE_FOREACH(pbktIn,pbbIn) | |
156 | + for(pbktIn = APR_BRIGADE_FIRST(pbbIn); pbktIn != APR_BRIGADE_SENTINEL(pbbIn); pbktIn = APR_BUCKET_NEXT(pbktIn)) | |
157 | { | |
158 | const char *data; | |
159 | apr_size_t len; | |
160 | diff -ur httpd-2.0.52.org/modules/experimental/mod_mem_cache.c httpd-2.0.52/modules/experimental/mod_mem_cache.c | |
161 | --- httpd-2.0.52.org/modules/experimental/mod_mem_cache.c 2004-10-01 01:16:29.346463667 +0200 | |
162 | +++ httpd-2.0.52/modules/experimental/mod_mem_cache.c 2004-10-01 01:19:11.266776038 +0200 | |
163 | @@ -140,14 +140,14 @@ | |
164 | cache_object_t *obj = (cache_object_t *)a; | |
165 | mem_cache_object_t *mobj = obj->vobj; | |
fa0f2add | 166 | |
fb7841c8 AM |
167 | - apr_atomic_set(&mobj->pos, pos); |
168 | + apr_atomic_set32(&mobj->pos, pos); | |
169 | } | |
170 | static apr_ssize_t memcache_get_pos(void *a) | |
171 | { | |
172 | cache_object_t *obj = (cache_object_t *)a; | |
173 | mem_cache_object_t *mobj = obj->vobj; | |
fa0f2add | 174 | |
fb7841c8 AM |
175 | - return apr_atomic_read(&mobj->pos); |
176 | + return apr_atomic_read32(&mobj->pos); | |
177 | } | |
fa0f2add | 178 | |
fb7841c8 AM |
179 | static apr_size_t memcache_cache_get_size(void*a) |
180 | @@ -177,7 +177,7 @@ | |
181 | /* Decrement the refcount to account for the object being ejected | |
182 | * from the cache. If the refcount is 0, free the object. | |
183 | */ | |
184 | - if (!apr_atomic_dec(&obj->refcount)) { | |
185 | + if (!apr_atomic_dec32(&obj->refcount)) { | |
186 | cleanup_cache_object(obj); | |
fa0f2add | 187 | } |
fb7841c8 AM |
188 | } |
189 | @@ -298,7 +298,7 @@ | |
190 | tobj = cache_find(sconf->cache_cache, obj->key); | |
191 | if (tobj == obj) { | |
192 | cache_remove(sconf->cache_cache, obj); | |
193 | - apr_atomic_dec(&obj->refcount); | |
194 | + apr_atomic_dec32(&obj->refcount); | |
195 | } | |
196 | if (sconf->lock) { | |
197 | apr_thread_mutex_unlock(sconf->lock); | |
198 | @@ -306,7 +306,7 @@ | |
199 | } | |
fa0f2add | 200 | |
fb7841c8 AM |
201 | /* If the refcount drops to 0, cleanup the cache object */ |
202 | - if (!apr_atomic_dec(&obj->refcount)) { | |
203 | + if (!apr_atomic_dec32(&obj->refcount)) { | |
204 | cleanup_cache_object(obj); | |
205 | } | |
206 | return APR_SUCCESS; | |
207 | @@ -329,7 +329,7 @@ | |
208 | obj = cache_pop(co->cache_cache); | |
209 | while (obj) { | |
210 | /* Iterate over the cache and clean up each unreferenced entry */ | |
211 | - if (!apr_atomic_dec(&obj->refcount)) { | |
212 | + if (!apr_atomic_dec32(&obj->refcount)) { | |
213 | cleanup_cache_object(obj); | |
fa0f2add | 214 | } |
fb7841c8 AM |
215 | obj = cache_pop(co->cache_cache); |
216 | @@ -425,7 +425,7 @@ | |
fa0f2add | 217 | } |
fa0f2add | 218 | |
fb7841c8 AM |
219 | /* Finish initing the cache object */ |
220 | - apr_atomic_set(&obj->refcount, 1); | |
221 | + apr_atomic_set32(&obj->refcount, 1); | |
222 | mobj->total_refs = 1; | |
223 | obj->complete = 0; | |
224 | obj->vobj = mobj; | |
225 | @@ -456,7 +456,7 @@ | |
226 | * hashtable in the cache. Refcount should be 2 now, one | |
227 | * for this thread, and one for the cache. | |
228 | */ | |
229 | - apr_atomic_inc(&obj->refcount); | |
230 | + apr_atomic_inc32(&obj->refcount); | |
fa0f2add | 231 | } |
fb7841c8 AM |
232 | if (sconf->lock) { |
233 | apr_thread_mutex_unlock(sconf->lock); | |
234 | @@ -504,7 +504,7 @@ | |
235 | if (obj) { | |
236 | if (obj->complete) { | |
237 | request_rec *rmain=r, *rtmp; | |
238 | - apr_atomic_inc(&obj->refcount); | |
239 | + apr_atomic_inc32(&obj->refcount); | |
240 | /* cache is worried about overall counts, not 'open' ones */ | |
241 | cache_update(sconf->cache_cache, obj); | |
fa0f2add | 242 | |
fb7841c8 AM |
243 | @@ -564,7 +564,7 @@ |
244 | tobj = cache_find(sconf->cache_cache, obj->key); | |
245 | if (tobj == obj) { | |
246 | cache_remove(sconf->cache_cache, obj); | |
247 | - apr_atomic_dec(&obj->refcount); | |
248 | + apr_atomic_dec32(&obj->refcount); | |
249 | } | |
250 | ||
251 | if (sconf->lock) { | |
252 | @@ -648,7 +648,7 @@ | |
253 | if (obj) { | |
254 | cache_remove(sconf->cache_cache, obj); | |
255 | /* For performance, cleanup cache object after releasing the lock */ | |
256 | - cleanup = !apr_atomic_dec(&obj->refcount); | |
257 | + cleanup = !apr_atomic_dec32(&obj->refcount); | |
258 | } | |
259 | if (sconf->lock) { | |
260 | apr_thread_mutex_unlock(sconf->lock); | |
261 | @@ -931,14 +931,14 @@ | |
262 | cache_remove(sconf->cache_cache, obj); | |
263 | /* For illustration, cache no longer has reference to the object | |
264 | * so decrement the refcount | |
265 | - * apr_atomic_dec(&obj->refcount); | |
266 | + * apr_atomic_dec32(&obj->refcount); | |
267 | */ | |
268 | mobj->m_len = obj->count; | |
269 | ||
270 | cache_insert(sconf->cache_cache, obj); | |
271 | /* For illustration, cache now has reference to the object, so | |
272 | * increment the refcount | |
273 | - * apr_atomic_inc(&obj->refcount); | |
274 | + * apr_atomic_inc32(&obj->refcount); | |
275 | */ | |
276 | } | |
277 | else if (tobj) { | |
278 | @@ -951,7 +951,7 @@ | |
279 | /* Object has been ejected from the cache, add it back to the cache */ | |
280 | mobj->m_len = obj->count; | |
281 | cache_insert(sconf->cache_cache, obj); | |
282 | - apr_atomic_inc(&obj->refcount); | |
283 | + apr_atomic_inc32(&obj->refcount); | |
284 | } | |
fa0f2add | 285 | |
fb7841c8 AM |
286 | if (sconf->lock) { |
287 | Tylko w httpd-2.0.52/modules/experimental: mod_mem_cache.c~ | |
288 | Tylko w httpd-2.0.52/modules/experimental: mod_mem_cache.c.orig | |
289 | Tylko w httpd-2.0.52/modules/experimental: mod_mem_cache.c.rej | |
290 | diff -ur httpd-2.0.52.org/modules/experimental/util_ldap.c httpd-2.0.52/modules/experimental/util_ldap.c | |
291 | --- httpd-2.0.52.org/modules/experimental/util_ldap.c 2004-10-01 01:16:29.422447389 +0200 | |
292 | +++ httpd-2.0.52/modules/experimental/util_ldap.c 2004-10-01 01:17:32.691893395 +0200 | |
293 | @@ -38,7 +38,7 @@ | |
294 | #include <unistd.h> | |
fa0f2add JB |
295 | #endif |
296 | ||
fb7841c8 AM |
297 | -#ifndef APU_HAS_LDAP |
298 | +#ifndef APR_HAS_LDAP | |
299 | #error mod_ldap requires APR-util to have LDAP support built in | |
300 | #endif | |
fa0f2add | 301 | |
fb7841c8 AM |
302 | diff -ur httpd-2.0.52.org/modules/experimental/util_ldap_cache.h httpd-2.0.52/modules/experimental/util_ldap_cache.h |
303 | --- httpd-2.0.52.org/modules/experimental/util_ldap_cache.h 2004-10-01 01:16:29.369458741 +0200 | |
304 | +++ httpd-2.0.52/modules/experimental/util_ldap_cache.h 2004-10-01 01:17:32.693892966 +0200 | |
305 | @@ -21,7 +21,7 @@ | |
306 | */ | |
fa0f2add | 307 | |
fb7841c8 AM |
308 | /* this whole thing disappears if LDAP is not enabled */ |
309 | -#ifdef APU_HAS_LDAP | |
310 | +#ifdef APR_HAS_LDAP | |
fa0f2add | 311 | |
fa0f2add | 312 | |
fb7841c8 AM |
313 | /* |
314 | diff -ur httpd-2.0.52.org/modules/filters/mod_deflate.c httpd-2.0.52/modules/filters/mod_deflate.c | |
315 | --- httpd-2.0.52.org/modules/filters/mod_deflate.c 2004-10-01 01:16:29.197495580 +0200 | |
316 | +++ httpd-2.0.52/modules/filters/mod_deflate.c 2004-10-01 01:17:32.678896179 +0200 | |
317 | @@ -694,7 +694,7 @@ | |
318 | return rv; | |
fa0f2add JB |
319 | } |
320 | ||
fb7841c8 AM |
321 | - APR_BRIGADE_FOREACH(bkt, ctx->bb) { |
322 | + for(bkt = APR_BRIGADE_FIRST(ctx->bb); bkt != APR_BRIGADE_SENTINEL(ctx->bb); bkt = APR_BUCKET_NEXT(bkt)) { | |
fa0f2add JB |
323 | const char *data; |
324 | apr_size_t len; | |
325 | ||
fb7841c8 AM |
326 | diff -ur httpd-2.0.52.org/modules/filters/mod_ext_filter.c httpd-2.0.52/modules/filters/mod_ext_filter.c |
327 | --- httpd-2.0.52.org/modules/filters/mod_ext_filter.c 2004-10-01 01:16:29.198495366 +0200 | |
328 | +++ httpd-2.0.52/modules/filters/mod_ext_filter.c 2004-10-01 01:17:32.675896821 +0200 | |
329 | @@ -487,18 +487,15 @@ | |
330 | ||
331 | #if APR_FILES_AS_SOCKETS | |
332 | { | |
333 | - apr_socket_t *newsock; | |
334 | - | |
335 | - rc = apr_poll_setup(&ctx->pollset, 2, ctx->p); | |
336 | - ap_assert(rc == APR_SUCCESS); | |
337 | - rc = apr_socket_from_file(&newsock, ctx->proc->in); | |
338 | - ap_assert(rc == APR_SUCCESS); | |
339 | - rc = apr_poll_socket_add(ctx->pollset, newsock, APR_POLLOUT); | |
340 | - ap_assert(rc == APR_SUCCESS); | |
341 | - rc = apr_socket_from_file(&newsock, ctx->proc->out); | |
342 | - ap_assert(rc == APR_SUCCESS); | |
343 | - rc = apr_poll_socket_add(ctx->pollset, newsock, APR_POLLIN); | |
344 | - ap_assert(rc == APR_SUCCESS); | |
345 | + ctx->pollset = apr_pcalloc(ctx->p, sizeof(apr_pollfd_t) * 2); | |
346 | + ctx->pollset[0].p = ctx->p; | |
347 | + ctx->pollset[0].desc.f = ctx->proc->in; | |
348 | + ctx->pollset[0].desc_type = APR_POLL_FILE; | |
349 | + ctx->pollset[0].reqevents = APR_POLLOUT; | |
350 | + ctx->pollset[1].p = ctx->p; | |
351 | + ctx->pollset[1].desc.f = ctx->proc->out; | |
352 | + ctx->pollset[1].desc_type = APR_POLL_FILE; | |
353 | + ctx->pollset[1].reqevents = APR_POLLIN; | |
fa0f2add | 354 | } |
fb7841c8 AM |
355 | #endif |
356 | ||
357 | @@ -744,7 +741,7 @@ | |
fa0f2add | 358 | } |
fb7841c8 | 359 | dc = ctx->dc; |
fa0f2add | 360 | |
fb7841c8 AM |
361 | - APR_BRIGADE_FOREACH(b, bb) { |
362 | + for(b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) { | |
363 | ||
364 | if (APR_BUCKET_IS_EOS(b)) { | |
365 | eos = b; | |
366 | diff -ur httpd-2.0.52.org/modules/filters/mod_include.c httpd-2.0.52/modules/filters/mod_include.c | |
367 | --- httpd-2.0.52.org/modules/filters/mod_include.c 2004-10-01 01:16:29.195496008 +0200 | |
368 | +++ httpd-2.0.52/modules/filters/mod_include.c 2004-10-01 01:17:32.684894894 +0200 | |
369 | @@ -209,7 +209,7 @@ | |
370 | val = ap_ht_time(r->pool, r->finfo.mtime, conf->default_time_fmt, 0); | |
371 | } | |
372 | else if (!strcasecmp(var, "USER_NAME")) { | |
373 | - if (apr_get_username(&val, r->finfo.user, r->pool) != APR_SUCCESS) { | |
374 | + if (apr_uid_name_get(&val, r->finfo.user, r->pool) != APR_SUCCESS) { | |
375 | val = "<unknown>"; | |
376 | } | |
fa0f2add | 377 | } |
fb7841c8 | 378 | @@ -3004,7 +3004,7 @@ |
fa0f2add | 379 | |
fb7841c8 AM |
380 | if (!APR_BRIGADE_EMPTY(pass_bb)) { |
381 | rv = ap_pass_brigade(f->next, pass_bb); | |
382 | - if (!APR_STATUS_IS_SUCCESS(rv)) { | |
383 | + if (rv != APR_SUCCESS) { | |
384 | apr_brigade_destroy(pass_bb); | |
385 | return rv; | |
fa0f2add | 386 | } |
fb7841c8 AM |
387 | @@ -3025,11 +3025,11 @@ |
388 | } | |
389 | } | |
fa0f2add | 390 | |
fb7841c8 AM |
391 | - if (!len || !APR_STATUS_IS_SUCCESS(rv)) { |
392 | + if (!len || (rv != APR_SUCCESS)) { | |
393 | rv = apr_bucket_read(b, &data, &len, APR_BLOCK_READ); | |
fa0f2add | 394 | } |
fb7841c8 AM |
395 | |
396 | - if (!APR_STATUS_IS_SUCCESS(rv)) { | |
397 | + if (rv != APR_SUCCESS) { | |
398 | apr_brigade_destroy(pass_bb); | |
399 | return rv; | |
fa0f2add | 400 | } |
fb7841c8 AM |
401 | diff -ur httpd-2.0.52.org/modules/generators/mod_autoindex.c httpd-2.0.52/modules/generators/mod_autoindex.c |
402 | --- httpd-2.0.52.org/modules/generators/mod_autoindex.c 2004-10-01 01:16:29.518426828 +0200 | |
403 | +++ httpd-2.0.52/modules/generators/mod_autoindex.c 2004-10-01 01:17:32.707889968 +0200 | |
404 | @@ -773,7 +773,7 @@ | |
405 | */ | |
406 | ||
407 | #ifdef CASE_BLIND_FILESYSTEM | |
408 | -#define MATCH_FLAGS FNM_CASE_BLIND | |
409 | +#define MATCH_FLAGS APR_FNM_CASE_BLIND | |
410 | #else | |
411 | #define MATCH_FLAGS 0 | |
412 | #endif | |
413 | @@ -1259,7 +1259,7 @@ | |
414 | ||
415 | #ifndef CASE_BLIND_FILESYSTEM | |
416 | if (pattern && (apr_fnmatch(pattern, dirent->name, | |
417 | - FNM_NOESCAPE | FNM_PERIOD) | |
418 | + APR_FNM_NOESCAPE | APR_FNM_PERIOD) | |
419 | != APR_SUCCESS)) | |
420 | return (NULL); | |
421 | #else /* !CASE_BLIND_FILESYSTEM */ | |
422 | @@ -1269,7 +1269,7 @@ | |
423 | * reliably - so we have to granularise at the OS level. | |
424 | */ | |
425 | if (pattern && (apr_fnmatch(pattern, dirent->name, | |
426 | - FNM_NOESCAPE | FNM_PERIOD | FNM_CASE_BLIND) | |
427 | + APR_FNM_NOESCAPE | APR_FNM_PERIOD | APR_FNM_CASE_BLIND) | |
428 | != APR_SUCCESS)) | |
429 | return (NULL); | |
430 | #endif /* !CASE_BLIND_FILESYSTEM */ | |
431 | diff -ur httpd-2.0.52.org/modules/generators/mod_cgi.c httpd-2.0.52/modules/generators/mod_cgi.c | |
432 | --- httpd-2.0.52.org/modules/generators/mod_cgi.c 2004-10-01 01:16:29.521426186 +0200 | |
433 | +++ httpd-2.0.52/modules/generators/mod_cgi.c 2004-10-01 01:17:32.710889325 +0200 | |
434 | @@ -274,7 +274,7 @@ | |
435 | apr_file_printf(f, "%s\n", sbuf); | |
436 | ||
437 | first = 1; | |
438 | - APR_BRIGADE_FOREACH(e, bb) { | |
439 | + for(e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) { | |
440 | if (APR_BUCKET_IS_EOS(e)) { | |
441 | break; | |
fa0f2add | 442 | } |
fb7841c8 AM |
443 | @@ -458,7 +458,7 @@ |
444 | /* Bad things happened. Everyone should have cleaned up. */ | |
445 | ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, rc, r, | |
446 | "couldn't create child process: %d: %s", rc, | |
447 | - apr_filename_of_pathname(r->filename)); | |
448 | + apr_filepath_name_get(r->filename)); | |
fa0f2add JB |
449 | } |
450 | else { | |
fb7841c8 AM |
451 | apr_pool_note_subprocess(p, procnew, APR_KILL_AFTER_TIMEOUT); |
452 | @@ -540,7 +540,7 @@ | |
453 | const char *buf; | |
454 | apr_size_t len; | |
455 | apr_status_t rv; | |
456 | - APR_BRIGADE_FOREACH(e, bb) { | |
457 | + for(e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) { | |
458 | if (APR_BUCKET_IS_EOS(e)) { | |
fa0f2add | 459 | break; |
fa0f2add | 460 | } |
fb7841c8 AM |
461 | @@ -750,7 +750,7 @@ |
462 | return DECLINED; | |
463 | } | |
fa0f2add | 464 | |
fb7841c8 AM |
465 | - argv0 = apr_filename_of_pathname(r->filename); |
466 | + argv0 = apr_filepath_name_get(r->filename); | |
467 | nph = !(strncmp(argv0, "nph-", 4)); | |
468 | conf = ap_get_module_config(r->server->module_config, &cgi_module); | |
fa0f2add | 469 | |
fb7841c8 AM |
470 | @@ -833,7 +833,7 @@ |
471 | return rv; | |
472 | } | |
fa0f2add | 473 | |
fb7841c8 AM |
474 | - APR_BRIGADE_FOREACH(bucket, bb) { |
475 | + for(bucket = APR_BRIGADE_FIRST(bb); bucket != APR_BRIGADE_SENTINEL(bb); bucket = APR_BUCKET_NEXT(bucket)) { | |
476 | const char *data; | |
477 | apr_size_t len; | |
fa0f2add | 478 | |
fb7841c8 AM |
479 | diff -ur httpd-2.0.52.org/modules/generators/mod_cgid.c httpd-2.0.52/modules/generators/mod_cgid.c |
480 | --- httpd-2.0.52.org/modules/generators/mod_cgid.c 2004-10-01 01:16:29.540422116 +0200 | |
481 | +++ httpd-2.0.52/modules/generators/mod_cgid.c 2004-10-01 01:17:32.713888683 +0200 | |
482 | @@ -748,7 +748,7 @@ | |
483 | */ | |
484 | ap_log_error(APLOG_MARK, APLOG_ERR, rc, r->server, | |
485 | "couldn't create child process: %d: %s", rc, | |
486 | - apr_filename_of_pathname(r->filename)); | |
487 | + apr_filepath_name_get(r->filename)); | |
488 | } | |
489 | else { | |
490 | /* We don't want to leak storage for the key, so only allocate | |
491 | @@ -1030,12 +1030,12 @@ | |
492 | apr_file_printf(f, "%s\n", sbuf); | |
fa0f2add | 493 | |
fb7841c8 AM |
494 | first = 1; |
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)) { | |
498 | break; | |
499 | } | |
500 | rv = apr_bucket_read(e, &buf, &len, APR_BLOCK_READ); | |
501 | - if (!APR_STATUS_IS_SUCCESS(rv) || (len == 0)) { | |
502 | + if ((rv != APR_SUCCESS) || (len == 0)) { | |
503 | break; | |
504 | } | |
505 | if (first) { | |
506 | @@ -1131,12 +1131,12 @@ | |
507 | const char *buf; | |
508 | apr_size_t len; | |
509 | apr_status_t rv; | |
510 | - APR_BRIGADE_FOREACH(e, bb) { | |
511 | + for(e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) { | |
512 | if (APR_BUCKET_IS_EOS(e)) { | |
513 | break; | |
514 | } | |
515 | rv = apr_bucket_read(e, &buf, &len, APR_BLOCK_READ); | |
516 | - if (!APR_STATUS_IS_SUCCESS(rv)) { | |
517 | + if (rv != APR_SUCCESS) { | |
518 | break; | |
519 | } | |
520 | } | |
521 | @@ -1370,7 +1370,7 @@ | |
522 | return rv; | |
523 | } | |
524 | ||
525 | - APR_BRIGADE_FOREACH(bucket, bb) { | |
526 | + for(bucket = APR_BRIGADE_FIRST(bb); bucket != APR_BRIGADE_SENTINEL(bb); bucket = APR_BUCKET_NEXT(bucket)) { | |
527 | const char *data; | |
528 | apr_size_t len; | |
fa0f2add | 529 | |
fb7841c8 AM |
530 | diff -ur httpd-2.0.52.org/modules/http/http_core.c httpd-2.0.52/modules/http/http_core.c |
531 | --- httpd-2.0.52.org/modules/http/http_core.c 2004-10-01 01:16:28.712599458 +0200 | |
532 | +++ httpd-2.0.52/modules/http/http_core.c 2004-10-01 01:17:32.610910743 +0200 | |
fa0f2add JB |
533 | @@ -115,7 +115,7 @@ |
534 | */ | |
535 | char chunk_hdr[20]; /* enough space for the snprintf below */ | |
536 | ||
537 | - APR_BRIGADE_FOREACH(e, b) { | |
538 | + for(e = APR_BRIGADE_FIRST(b); e != APR_BRIGADE_SENTINEL(b); e = APR_BUCKET_NEXT(e)) { | |
539 | if (APR_BUCKET_IS_EOS(e)) { | |
540 | /* there shouldn't be anything after the eos */ | |
541 | eos = e; | |
fb7841c8 AM |
542 | diff -ur httpd-2.0.52.org/modules/http/http_protocol.c httpd-2.0.52/modules/http/http_protocol.c |
543 | --- httpd-2.0.52.org/modules/http/http_protocol.c 2004-10-01 01:16:28.710599886 +0200 | |
544 | +++ httpd-2.0.52/modules/http/http_protocol.c 2004-10-01 01:17:32.615909672 +0200 | |
fa0f2add JB |
545 | @@ -1534,7 +1534,7 @@ |
546 | } | |
547 | } | |
548 | ||
549 | - APR_BRIGADE_FOREACH(e, b) { | |
550 | + for(e = APR_BRIGADE_FIRST(b); e != APR_BRIGADE_SENTINEL(b); e = APR_BUCKET_NEXT(e)) { | |
551 | if (e->type == &ap_bucket_type_error) { | |
552 | ap_bucket_error *eb = e->data; | |
553 | ||
554 | @@ -1976,7 +1976,7 @@ | |
555 | } | |
556 | } | |
557 | ||
558 | - APR_BRIGADE_FOREACH(bucket, bb) { | |
559 | + for(bucket = APR_BRIGADE_FIRST(bb); bucket != APR_BRIGADE_SENTINEL(bb); bucket = APR_BUCKET_NEXT(bucket)) { | |
560 | const char *data; | |
561 | apr_size_t len; | |
562 | ||
fb7841c8 AM |
563 | diff -ur httpd-2.0.52.org/modules/mappers/mod_negotiation.c httpd-2.0.52/modules/mappers/mod_negotiation.c |
564 | --- httpd-2.0.52.org/modules/mappers/mod_negotiation.c 2004-10-01 01:16:29.046527921 +0200 | |
565 | +++ httpd-2.0.52/modules/mappers/mod_negotiation.c 2004-10-01 01:17:32.664899177 +0200 | |
566 | @@ -959,7 +959,7 @@ | |
567 | break; | |
568 | } | |
569 | mime_info.bytes = len; | |
570 | - mime_info.file_name = apr_filename_of_pathname(rr->filename); | |
571 | + mime_info.file_name = apr_filepath_name_get(rr->filename); | |
572 | } | |
fa0f2add | 573 | } |
fb7841c8 AM |
574 | else { |
575 | diff -ur httpd-2.0.52.org/modules/mappers/mod_rewrite.c httpd-2.0.52/modules/mappers/mod_rewrite.c | |
576 | --- httpd-2.0.52.org/modules/mappers/mod_rewrite.c 2004-10-01 01:16:29.043528564 +0200 | |
577 | +++ httpd-2.0.52/modules/mappers/mod_rewrite.c 2004-10-01 01:17:32.671897678 +0200 | |
578 | @@ -2323,7 +2323,7 @@ | |
579 | } | |
580 | else if (strcmp(p->pattern, "-l") == 0) { | |
581 | #if !defined(OS2) | |
582 | - if (apr_lstat(&sb, input, APR_FINFO_MIN, r->pool) == APR_SUCCESS) { | |
583 | + if (apr_stat(&sb, input, APR_FINFO_MIN | APR_FINFO_LINK, r->pool) == APR_SUCCESS) { | |
584 | if (sb.filetype == APR_LNK) { | |
585 | rc = 1; | |
586 | } | |
587 | @@ -2949,7 +2949,7 @@ | |
588 | user[j] = '\0'; | |
fa0f2add | 589 | |
fb7841c8 AM |
590 | /* lookup username in systems passwd file */ |
591 | - if (apr_get_home_directory(&homedir, user, r->pool) == APR_SUCCESS) { | |
592 | + if (apr_uid_homepath_get(&homedir, user, r->pool) == APR_SUCCESS) { | |
593 | /* ok, user was found, so expand the ~user string */ | |
594 | if (uri[i] != '\0') { | |
595 | /* ~user/anything... has to be expanded */ | |
596 | @@ -3962,13 +3962,13 @@ | |
597 | else if (strcasecmp(var, "SCRIPT_USER") == 0) { | |
598 | result = "<unknown>"; | |
599 | if (r->finfo.valid & APR_FINFO_USER) { | |
600 | - apr_get_username((char **)&result, r->finfo.user, r->pool); | |
601 | + apr_uid_name_get((char **)&result, r->finfo.user, r->pool); | |
602 | } | |
603 | } | |
604 | else if (strcasecmp(var, "SCRIPT_GROUP") == 0) { | |
605 | result = "<unknown>"; | |
606 | if (r->finfo.valid & APR_FINFO_GROUP) { | |
607 | - apr_group_name_get((char **)&result, r->finfo.group, r->pool); | |
608 | + apr_gid_name_get((char **)&result, r->finfo.group, r->pool); | |
609 | } | |
610 | } else if (strcasecmp(var, "HTTPS") == 0) { | |
611 | int flag = rewrite_is_https && rewrite_is_https(r->connection); | |
612 | diff -ur httpd-2.0.52.org/modules/mappers/mod_userdir.c httpd-2.0.52/modules/mappers/mod_userdir.c | |
613 | --- httpd-2.0.52.org/modules/mappers/mod_userdir.c 2004-10-01 01:16:29.053526422 +0200 | |
614 | +++ httpd-2.0.52/modules/mappers/mod_userdir.c 2004-10-01 01:17:32.673897250 +0200 | |
615 | @@ -282,7 +282,7 @@ | |
616 | #if APR_HAS_USER | |
617 | char *homedir; | |
fa0f2add | 618 | |
fb7841c8 AM |
619 | - if (apr_get_home_directory(&homedir, w, r->pool) == APR_SUCCESS) { |
620 | + if (apr_uid_homepath_get(&homedir, w, r->pool) == APR_SUCCESS) { | |
621 | filename = apr_pstrcat(r->pool, homedir, "/", userdir, NULL); | |
622 | } | |
623 | #else | |
624 | @@ -333,7 +333,7 @@ | |
625 | return NULL; | |
fa0f2add | 626 | } |
fb7841c8 AM |
627 | |
628 | - if (apr_get_userid(&ugid->uid, &ugid->gid, username, r->pool) != APR_SUCCESS) { | |
629 | + if (apr_uid_get(&ugid->uid, &ugid->gid, username, r->pool) != APR_SUCCESS) { | |
630 | return NULL; | |
fa0f2add | 631 | } |
fb7841c8 AM |
632 | |
633 | diff -ur httpd-2.0.52.org/modules/proxy/proxy_connect.c httpd-2.0.52/modules/proxy/proxy_connect.c | |
634 | --- httpd-2.0.52.org/modules/proxy/proxy_connect.c 2004-10-01 01:16:29.014534775 +0200 | |
635 | +++ httpd-2.0.52/modules/proxy/proxy_connect.c 2004-10-01 01:17:32.659900248 +0200 | |
636 | @@ -224,10 +224,10 @@ | |
637 | "proxy: CONNECT: sending the CONNECT request to the remote proxy"); | |
638 | nbytes = apr_snprintf(buffer, sizeof(buffer), | |
639 | "CONNECT %s HTTP/1.0" CRLF, r->uri); | |
640 | - apr_send(sock, buffer, &nbytes); | |
641 | + apr_socket_send(sock, buffer, &nbytes); | |
642 | nbytes = apr_snprintf(buffer, sizeof(buffer), | |
643 | "Proxy-agent: %s" CRLF CRLF, ap_get_server_version()); | |
644 | - apr_send(sock, buffer, &nbytes); | |
645 | + apr_socket_send(sock, buffer, &nbytes); | |
fa0f2add JB |
646 | } |
647 | else { | |
fb7841c8 AM |
648 | ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, |
649 | @@ -235,11 +235,11 @@ | |
650 | nbytes = apr_snprintf(buffer, sizeof(buffer), | |
651 | "HTTP/1.0 200 Connection Established" CRLF); | |
652 | ap_xlate_proto_to_ascii(buffer, nbytes); | |
653 | - apr_send(client_socket, buffer, &nbytes); | |
654 | + apr_socket_send(client_socket, buffer, &nbytes); | |
655 | nbytes = apr_snprintf(buffer, sizeof(buffer), | |
656 | "Proxy-agent: %s" CRLF CRLF, ap_get_server_version()); | |
657 | ap_xlate_proto_to_ascii(buffer, nbytes); | |
658 | - apr_send(client_socket, buffer, &nbytes); | |
659 | + apr_socket_send(client_socket, buffer, &nbytes); | |
660 | #if 0 | |
661 | /* This is safer code, but it doesn't work yet. I'm leaving it | |
662 | * here so that I can fix it later. | |
663 | @@ -262,7 +262,7 @@ | |
fa0f2add | 664 | |
fb7841c8 | 665 | /* r->sent_bodyct = 1;*/ |
fa0f2add | 666 | |
fb7841c8 AM |
667 | - if((rv = apr_poll_setup(&pollfd, 2, r->pool)) != APR_SUCCESS) |
668 | + if((pollfd = apr_pcalloc(r->pool, sizeof(apr_pollfd_t) * 2)) == NULL) | |
669 | { | |
670 | apr_socket_close(sock); | |
671 | ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, | |
672 | @@ -271,10 +271,16 @@ | |
673 | } | |
fa0f2add | 674 | |
fb7841c8 AM |
675 | /* Add client side to the poll */ |
676 | - apr_poll_socket_add(pollfd, client_socket, APR_POLLIN); | |
677 | + pollfd[0].p = r->pool; | |
678 | + pollfd[0].desc.s = client_socket; | |
679 | + pollfd[0].desc_type = APR_POLL_SOCKET; | |
680 | + pollfd[0].reqevents = APR_POLLIN; | |
fa0f2add | 681 | |
fb7841c8 AM |
682 | /* Add the server side to the poll */ |
683 | - apr_poll_socket_add(pollfd, sock, APR_POLLIN); | |
684 | + pollfd[1].p = r->pool; | |
685 | + pollfd[1].desc.s = sock; | |
686 | + pollfd[1].desc_type = APR_POLL_SOCKET; | |
687 | + pollfd[1].reqevents = APR_POLLIN; | |
fa0f2add | 688 | |
fb7841c8 AM |
689 | while (1) { /* Infinite loop until error (one side closes the connection) */ |
690 | /* ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: CONNECT: going to sleep (poll)");*/ | |
691 | @@ -288,12 +294,12 @@ | |
692 | "proxy: CONNECT: woke from select(), i=%d", pollcnt);*/ | |
fa0f2add | 693 | |
fb7841c8 AM |
694 | if (pollcnt) { |
695 | - apr_poll_revents_get(&pollevent, sock, pollfd); | |
696 | + pollevent = pollfd[1].rtnevents; | |
697 | if (pollevent & APR_POLLIN) { | |
698 | /* ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, | |
699 | "proxy: CONNECT: sock was set");*/ | |
700 | nbytes = sizeof(buffer); | |
701 | - if (apr_recv(sock, buffer, &nbytes) == APR_SUCCESS) { | |
702 | + if (apr_socket_recv(sock, buffer, &nbytes) == APR_SUCCESS) { | |
703 | o = 0; | |
704 | i = nbytes; | |
705 | while(i > 0) | |
706 | @@ -305,7 +311,7 @@ | |
707 | * if ((nbytes = ap_rwrite(buffer + o, nbytes, r)) < 0) | |
708 | * rbb | |
709 | */ | |
710 | - if (apr_send(client_socket, buffer + o, &nbytes) != APR_SUCCESS) | |
711 | + if (apr_socket_send(client_socket, buffer + o, &nbytes) != APR_SUCCESS) | |
712 | break; | |
713 | o += nbytes; | |
714 | i -= nbytes; | |
715 | @@ -318,18 +324,18 @@ | |
716 | break; | |
fa0f2add | 717 | |
fa0f2add | 718 | |
fb7841c8 AM |
719 | - apr_poll_revents_get(&pollevent, client_socket, pollfd); |
720 | + pollevent = pollfd[0].rtnevents; | |
721 | if (pollevent & APR_POLLIN) { | |
722 | /* ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, | |
723 | "proxy: CONNECT: client was set");*/ | |
724 | nbytes = sizeof(buffer); | |
725 | - if (apr_recv(client_socket, buffer, &nbytes) == APR_SUCCESS) { | |
726 | + if (apr_socket_recv(client_socket, buffer, &nbytes) == APR_SUCCESS) { | |
727 | o = 0; | |
728 | i = nbytes; | |
729 | while(i > 0) | |
730 | { | |
731 | nbytes = i; | |
732 | - if (apr_send(sock, buffer + o, &nbytes) != APR_SUCCESS) | |
733 | + if (apr_socket_send(sock, buffer + o, &nbytes) != APR_SUCCESS) | |
734 | break; | |
735 | o += nbytes; | |
736 | i -= nbytes; | |
737 | diff -ur httpd-2.0.52.org/modules/proxy/proxy_ftp.c httpd-2.0.52/modules/proxy/proxy_ftp.c | |
738 | --- httpd-2.0.52.org/modules/proxy/proxy_ftp.c 2004-10-01 01:16:29.013534989 +0200 | |
739 | +++ httpd-2.0.52/modules/proxy/proxy_ftp.c 2004-10-01 01:17:32.654901319 +0200 | |
fa0f2add JB |
740 | @@ -931,7 +931,7 @@ |
741 | int failed = 1; | |
742 | while (connect_addr) { | |
743 | ||
744 | - if ((rv = apr_socket_create(&sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) { | |
745 | + if ((rv = apr_socket_create(&sock, connect_addr->family, SOCK_STREAM, APR_PROTO_TCP, r->pool)) != APR_SUCCESS) { | |
746 | ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, | |
747 | "proxy: FTP: error creating socket"); | |
748 | connect_addr = connect_addr->next; | |
749 | @@ -970,7 +970,7 @@ | |
750 | connect_addr->family, connect_addr, connectname); | |
751 | ||
752 | /* make the connection out of the socket */ | |
753 | - rv = apr_connect(sock, connect_addr); | |
754 | + rv = apr_socket_connect(sock, connect_addr); | |
755 | ||
756 | /* if an error occurred, loop round and try again */ | |
757 | if (rv != APR_SUCCESS) { | |
758 | @@ -1249,7 +1249,7 @@ | |
759 | "proxy: FTP: EPSV contacting remote host on port %d", | |
760 | data_port); | |
761 | ||
762 | - if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) { | |
763 | + if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, APR_PROTO_TCP, r->pool)) != APR_SUCCESS) { | |
764 | ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, | |
765 | "proxy: FTP: error creating EPSV socket"); | |
766 | return HTTP_INTERNAL_SERVER_ERROR; | |
767 | @@ -1268,7 +1268,7 @@ | |
768 | apr_socket_addr_get(&data_addr, APR_REMOTE, sock); | |
769 | apr_sockaddr_ip_get(&data_ip, data_addr); | |
770 | apr_sockaddr_info_get(&epsv_addr, data_ip, connect_addr->family, data_port, 0, p); | |
771 | - rv = apr_connect(data_sock, epsv_addr); | |
772 | + rv = apr_socket_connect(data_sock, epsv_addr); | |
773 | if (rv != APR_SUCCESS) { | |
774 | ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, | |
775 | "proxy: FTP: EPSV attempt to connect to %pI failed - Firewall/NAT?", epsv_addr); | |
776 | @@ -1336,7 +1336,7 @@ | |
777 | "proxy: FTP: PASV contacting host %d.%d.%d.%d:%d", | |
778 | h3, h2, h1, h0, pasvport); | |
779 | ||
780 | - if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) { | |
781 | + if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, APR_PROTO_TCP, r->pool)) != APR_SUCCESS) { | |
782 | ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, | |
783 | "proxy: error creating PASV socket"); | |
784 | return HTTP_INTERNAL_SERVER_ERROR; | |
785 | @@ -1353,7 +1353,7 @@ | |
786 | ||
787 | /* make the connection */ | |
788 | apr_sockaddr_info_get(&pasv_addr, apr_psprintf(p, "%d.%d.%d.%d", h3, h2, h1, h0), connect_addr->family, pasvport, 0, p); | |
789 | - rv = apr_connect(data_sock, pasv_addr); | |
790 | + rv = apr_socket_connect(data_sock, pasv_addr); | |
791 | if (rv != APR_SUCCESS) { | |
792 | ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, | |
793 | "proxy: FTP: PASV attempt to connect to %pI failed - Firewall/NAT?", pasv_addr); | |
794 | @@ -1379,13 +1379,13 @@ | |
795 | apr_port_t local_port; | |
796 | unsigned int h0, h1, h2, h3, p0, p1; | |
797 | ||
798 | - if ((rv = apr_socket_create(&local_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) { | |
799 | + if ((rv = apr_socket_create(&local_sock, connect_addr->family, SOCK_STREAM, APR_PROTO_TCP, r->pool)) != APR_SUCCESS) { | |
800 | ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, | |
801 | "proxy: FTP: error creating local socket"); | |
802 | return HTTP_INTERNAL_SERVER_ERROR; | |
803 | } | |
804 | apr_socket_addr_get(&local_addr, APR_LOCAL, sock); | |
805 | - apr_sockaddr_port_get(&local_port, local_addr); | |
806 | + local_port = local_addr->port; | |
807 | apr_sockaddr_ip_get(&local_ip, local_addr); | |
808 | ||
809 | if ((rv = apr_socket_opt_set(local_sock, APR_SO_REUSEADDR, one)) | |
810 | @@ -1399,14 +1399,14 @@ | |
811 | ||
812 | apr_sockaddr_info_get(&local_addr, local_ip, APR_UNSPEC, local_port, 0, r->pool); | |
813 | ||
814 | - if ((rv = apr_bind(local_sock, local_addr)) != APR_SUCCESS) { | |
815 | + if ((rv = apr_socket_bind(local_sock, local_addr)) != APR_SUCCESS) { | |
816 | ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, | |
817 | "proxy: FTP: error binding to ftp data socket %pI", local_addr); | |
818 | return HTTP_INTERNAL_SERVER_ERROR; | |
819 | } | |
820 | ||
821 | /* only need a short queue */ | |
822 | - if ((rv = apr_listen(local_sock, 2)) != APR_SUCCESS) { | |
823 | + if ((rv = apr_socket_listen(local_sock, 2)) != APR_SUCCESS) { | |
824 | ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, | |
825 | "proxy: FTP: error listening to ftp data socket %pI", local_addr); | |
826 | return HTTP_INTERNAL_SERVER_ERROR; | |
827 | @@ -1743,7 +1743,7 @@ | |
828 | /* wait for connection */ | |
829 | if (use_port) { | |
830 | for (;;) { | |
831 | - rv = apr_accept(&data_sock, local_sock, r->pool); | |
832 | + rv = apr_socket_accept(&data_sock, local_sock, r->pool); | |
833 | if (rv == APR_EINTR) { | |
834 | continue; | |
835 | } | |
fb7841c8 AM |
836 | diff -ur httpd-2.0.52.org/modules/proxy/proxy_http.c httpd-2.0.52/modules/proxy/proxy_http.c |
837 | --- httpd-2.0.52.org/modules/proxy/proxy_http.c 2004-10-01 01:16:28.936551481 +0200 | |
838 | +++ httpd-2.0.52/modules/proxy/proxy_http.c 2004-10-01 01:17:32.657900677 +0200 | |
fa0f2add JB |
839 | @@ -294,7 +294,7 @@ |
840 | apr_socket_timeout_get(p_conn->sock, ¤t_timeout); | |
841 | /* set no timeout */ | |
842 | apr_socket_timeout_set(p_conn->sock, 0); | |
843 | - socket_status = apr_recv(p_conn->sock, test_buffer, &buffer_len); | |
844 | + socket_status = apr_socket_recv(p_conn->sock, test_buffer, &buffer_len); | |
845 | /* put back old timeout */ | |
846 | apr_socket_timeout_set(p_conn->sock, current_timeout); | |
847 | if ( APR_STATUS_IS_EOF(socket_status) ) { | |
fb7841c8 AM |
848 | diff -ur httpd-2.0.52.org/modules/proxy/proxy_util.c httpd-2.0.52/modules/proxy/proxy_util.c |
849 | --- httpd-2.0.52.org/modules/proxy/proxy_util.c 2004-10-01 01:16:28.966545056 +0200 | |
850 | +++ httpd-2.0.52/modules/proxy/proxy_util.c 2004-10-01 01:17:32.650902176 +0200 | |
851 | @@ -1102,7 +1102,7 @@ | |
852 | ||
853 | while (backend_addr && !connected) { | |
854 | if ((rv = apr_socket_create(newsock, backend_addr->family, | |
855 | - SOCK_STREAM, p)) != APR_SUCCESS) { | |
856 | + SOCK_STREAM, APR_PROTO_TCP, p)) != APR_SUCCESS) { | |
857 | loglevel = backend_addr->next ? APLOG_DEBUG : APLOG_ERR; | |
858 | ap_log_error(APLOG_MARK, loglevel, rv, s, | |
859 | "proxy: %s: error creating fam %d socket for target %s", | |
860 | @@ -1140,7 +1140,7 @@ | |
861 | proxy_function, backend_addr->family, backend_name); | |
fa0f2add | 862 | |
fb7841c8 AM |
863 | /* make the connection out of the socket */ |
864 | - rv = apr_connect(*newsock, backend_addr); | |
865 | + rv = apr_socket_connect(*newsock, backend_addr); | |
fa0f2add | 866 | |
fb7841c8 AM |
867 | /* if an error occurred, loop round and try again */ |
868 | if (rv != APR_SUCCESS) { | |
869 | diff -ur httpd-2.0.52.org/modules/ssl/mod_ssl.c httpd-2.0.52/modules/ssl/mod_ssl.c | |
870 | --- httpd-2.0.52.org/modules/ssl/mod_ssl.c 2004-10-01 01:16:28.403665640 +0200 | |
871 | +++ httpd-2.0.52/modules/ssl/mod_ssl.c 2004-10-01 01:17:32.640904318 +0200 | |
872 | @@ -333,7 +333,7 @@ | |
873 | sc->vhost_id_len); | |
874 | ||
875 | if (!SSL_set_session_id_context(ssl, (unsigned char *)vhost_md5, | |
876 | - MD5_DIGESTSIZE*2)) | |
877 | + APR_MD5_DIGESTSIZE*2)) | |
fa0f2add | 878 | { |
fb7841c8 AM |
879 | ap_log_error(APLOG_MARK, APLOG_ERR, 0, c->base_server, |
880 | "Unable to set session id context to `%s'", vhost_md5); | |
881 | diff -ur httpd-2.0.52.org/modules/ssl/ssl_engine_init.c httpd-2.0.52/modules/ssl/ssl_engine_init.c | |
882 | --- httpd-2.0.52.org/modules/ssl/ssl_engine_init.c 2004-10-01 01:16:28.423661356 +0200 | |
883 | +++ httpd-2.0.52/modules/ssl/ssl_engine_init.c 2004-10-01 01:17:32.643903675 +0200 | |
884 | @@ -823,11 +823,11 @@ | |
fa0f2add JB |
885 | } |
886 | ||
fb7841c8 AM |
887 | if (SSL_X509_getCN(ptemp, cert, &cn)) { |
888 | - int fnm_flags = FNM_PERIOD|FNM_CASE_BLIND; | |
889 | + int fnm_flags = APR_FNM_PERIOD|APR_FNM_CASE_BLIND; | |
fa0f2add | 890 | |
fb7841c8 AM |
891 | if (apr_fnmatch_test(cn) && |
892 | (apr_fnmatch(cn, s->server_hostname, | |
893 | - fnm_flags) == FNM_NOMATCH)) | |
894 | + fnm_flags) == APR_FNM_NOMATCH)) | |
895 | { | |
896 | ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, | |
897 | "%s server certificate wildcard CommonName (CN) `%s' " | |
898 | diff -ur httpd-2.0.52.org/modules/ssl/ssl_scache_dbm.c httpd-2.0.52/modules/ssl/ssl_scache_dbm.c | |
899 | --- httpd-2.0.52.org/modules/ssl/ssl_scache_dbm.c 2004-10-01 01:16:28.422661570 +0200 | |
900 | +++ httpd-2.0.52/modules/ssl/ssl_scache_dbm.c 2004-10-01 01:17:32.645903247 +0200 | |
901 | @@ -84,7 +84,7 @@ | |
902 | SSLModConfigRec *mc = myModConfig(s); | |
903 | apr_pool_t *p; | |
fa0f2add | 904 | |
fb7841c8 AM |
905 | - apr_pool_sub_make(&p, mc->pPool, NULL); |
906 | + apr_pool_create_ex(&p, mc->pPool, NULL, NULL); | |
907 | if (p != NULL) { | |
908 | /* the correct way */ | |
909 | unlink(apr_pstrcat(p, mc->szSessionCacheDataFile, SSL_DBM_FILE_SUFFIX_DIR, NULL)); | |
910 | @@ -331,7 +331,7 @@ | |
911 | ssl_mutex_on(s); | |
912 | for (;;) { | |
913 | /* allocate the key array in a memory sub pool */ | |
914 | - apr_pool_sub_make(&p, mc->pPool, NULL); | |
915 | + apr_pool_create_ex(&p, mc->pPool, NULL, NULL); | |
916 | if (p == NULL) | |
917 | break; | |
918 | if ((keylist = apr_palloc(p, sizeof(dbmkey)*KEYMAX)) == NULL) { | |
919 | diff -ur httpd-2.0.52.org/os/unix/unixd.c httpd-2.0.52/os/unix/unixd.c | |
920 | --- httpd-2.0.52.org/os/unix/unixd.c 2004-10-01 01:16:29.554419118 +0200 | |
921 | +++ httpd-2.0.52/os/unix/unixd.c 2004-10-01 01:17:32.622908173 +0200 | |
922 | @@ -464,7 +464,7 @@ | |
923 | apr_status_t status; | |
fa0f2add | 924 | |
fb7841c8 AM |
925 | *accepted = NULL; |
926 | - status = apr_accept(&csd, lr->sd, ptrans); | |
927 | + status = apr_socket_accept(&csd, lr->sd, ptrans); | |
928 | if (status == APR_SUCCESS) { | |
929 | *accepted = csd; | |
930 | return APR_SUCCESS; | |
931 | diff -ur httpd-2.0.52.org/server/config.c httpd-2.0.52/server/config.c | |
932 | --- httpd-2.0.52.org/server/config.c 2004-10-01 01:16:29.746377995 +0200 | |
933 | +++ httpd-2.0.52/server/config.c 2004-10-01 01:17:32.564920595 +0200 | |
934 | @@ -1546,7 +1546,7 @@ | |
935 | && !(strcmp(fname, ap_server_root_relative(p, SERVER_CONFIG_FILE)))) { | |
936 | apr_finfo_t finfo; | |
fa0f2add | 937 | |
fb7841c8 AM |
938 | - if (apr_lstat(&finfo, fname, APR_FINFO_TYPE, p) != APR_SUCCESS) |
939 | + if (apr_stat(&finfo, fname, APR_FINFO_TYPE | APR_FINFO_LINK, p) != APR_SUCCESS) | |
940 | return; | |
941 | } | |
fa0f2add | 942 | |
fb7841c8 AM |
943 | @@ -1605,7 +1605,7 @@ |
944 | if (strcmp(dirent.name, ".") | |
945 | && strcmp(dirent.name, "..") | |
946 | && (apr_fnmatch(pattern, dirent.name, | |
947 | - FNM_PERIOD) == APR_SUCCESS)) { | |
948 | + APR_FNM_PERIOD) == APR_SUCCESS)) { | |
949 | fnew = (fnames *) apr_array_push(candidates); | |
950 | fnew->fname = ap_make_full_path(p, path, dirent.name); | |
fa0f2add | 951 | } |
fb7841c8 AM |
952 | diff -ur httpd-2.0.52.org/server/connection.c httpd-2.0.52/server/connection.c |
953 | --- httpd-2.0.52.org/server/connection.c 2004-10-01 01:16:29.743378637 +0200 | |
954 | +++ httpd-2.0.52/server/connection.c 2004-10-01 01:17:32.602912457 +0200 | |
955 | @@ -131,7 +131,7 @@ | |
956 | /* Shut down the socket for write, which will send a FIN | |
957 | * to the peer. | |
958 | */ | |
959 | - if (apr_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS | |
960 | + if (apr_socket_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS | |
961 | || c->aborted) { | |
962 | apr_socket_close(csd); | |
963 | return; | |
964 | @@ -147,7 +147,7 @@ | |
965 | apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1); | |
966 | while (1) { | |
967 | nbytes = sizeof(dummybuf); | |
968 | - rc = apr_recv(csd, dummybuf, &nbytes); | |
969 | + rc = apr_socket_recv(csd, dummybuf, &nbytes); | |
970 | if (rc != APR_SUCCESS || nbytes == 0) | |
971 | break; | |
972 | ||
973 | diff -ur httpd-2.0.52.org/server/core.c httpd-2.0.52/server/core.c | |
974 | --- httpd-2.0.52.org/server/core.c 2004-10-01 01:16:29.868351865 +0200 | |
975 | +++ httpd-2.0.52/server/core.c 2004-10-01 01:17:32.578917597 +0200 | |
976 | @@ -2916,7 +2916,7 @@ | |
977 | ||
978 | /* XXX handle checking for non-blocking socket */ | |
979 | while (bytes_written != len) { | |
980 | - rv = apr_sendv(s, vec + i, nvec - i, &n); | |
981 | + rv = apr_socket_sendv(s, vec + i, nvec - i, &n); | |
982 | bytes_written += n; | |
983 | if (rv != APR_SUCCESS) | |
984 | return rv; | |
985 | @@ -2924,7 +2924,7 @@ | |
986 | *nbytes += n; | |
987 | ||
988 | /* If the write did not complete, adjust the iovecs and issue | |
989 | - * apr_sendv again | |
990 | + * apr_socket_sendv again | |
991 | */ | |
992 | if (bytes_written < len) { | |
993 | /* Skip over the vectors that have already been written */ | |
994 | @@ -2979,7 +2979,7 @@ | |
995 | do { | |
996 | apr_size_t tmplen = file_bytes_left; | |
997 | ||
998 | - rv = apr_sendfile(c->client_socket, fd, hdtr, &file_offset, &tmplen, | |
999 | + rv = apr_socket_sendfile(c->client_socket, fd, hdtr, &file_offset, &tmplen, | |
1000 | flags); | |
1001 | *bytes_sent += tmplen; | |
1002 | total_bytes_left -= tmplen; | |
1003 | @@ -3090,7 +3090,7 @@ | |
1004 | rv = apr_file_read(fd, buffer, &sendlen); | |
1005 | while (rv == APR_SUCCESS && sendlen) { | |
1006 | bytes_sent = sendlen; | |
1007 | - rv = apr_send(c->client_socket, &buffer[o], &bytes_sent); | |
1008 | + rv = apr_socket_send(c->client_socket, &buffer[o], &bytes_sent); | |
1009 | if (rv == APR_SUCCESS) { | |
1010 | sendlen -= bytes_sent; /* sendlen != bytes_sent ==> partial write */ | |
1011 | o += bytes_sent; /* o is where we are in the buffer */ | |
1012 | @@ -3873,7 +3873,7 @@ | |
fa0f2add | 1013 | } |
fb7841c8 AM |
1014 | else if (mode == AP_MODE_SPECULATIVE) { |
1015 | apr_bucket *copy_bucket; | |
1016 | - APR_BRIGADE_FOREACH(e, ctx->b) { | |
1017 | + for(e = APR_BRIGADE_FIRST(ctx->b); e != APR_BRIGADE_SENTINEL(ctx->b); e = APR_BUCKET_NEXT(e)) { | |
1018 | rv = apr_bucket_copy(e, ©_bucket); | |
1019 | if (rv != APR_SUCCESS) { | |
1020 | return rv; | |
1021 | @@ -3948,7 +3948,7 @@ | |
1022 | more = NULL; | |
1023 | ||
1024 | /* Iterate over the brigade: collect iovecs and/or a file */ | |
1025 | - APR_BRIGADE_FOREACH(e, b) { | |
1026 | + for(e = APR_BRIGADE_FIRST(b); e != APR_BRIGADE_SENTINEL(b); e = APR_BUCKET_NEXT(e)) { | |
1027 | /* keep track of the last bucket processed */ | |
1028 | last_e = e; | |
1029 | if (APR_BUCKET_IS_EOS(e) || AP_BUCKET_IS_EOC(e)) { | |
1030 | @@ -4212,7 +4212,7 @@ | |
1031 | headers */ | |
1032 | &bytes_sent, /* how many bytes were | |
1033 | sent */ | |
1034 | - flags); /* apr_sendfile flags */ | |
1035 | + flags); /* apr_socket_sendfile flags */ | |
1036 | ||
1037 | if (logio_add_bytes_out && bytes_sent > 0) | |
1038 | logio_add_bytes_out(c, bytes_sent); | |
1039 | diff -ur httpd-2.0.52.org/server/core.c.orig httpd-2.0.52/server/core.c.orig | |
1040 | --- httpd-2.0.52.org/server/core.c.orig 2004-10-01 01:16:29.835358933 +0200 | |
1041 | +++ httpd-2.0.52/server/core.c.orig 2004-10-01 01:15:36.982681379 +0200 | |
1042 | @@ -4298,6 +4298,25 @@ | |
1043 | ||
1044 | ap_set_version(pconf); | |
1045 | ap_setup_make_content_type(pconf); | |
1046 | + | |
1047 | +#ifdef RLIMIT_CORE | |
1048 | + if (ap_coredumpdir_configured) { | |
1049 | + struct rlimit lim; | |
1050 | + | |
1051 | + if (getrlimit(RLIMIT_CORE, &lim) == 0 && lim.rlim_cur == 0) { | |
1052 | + lim.rlim_cur = lim.rlim_max; | |
1053 | + if (setrlimit(RLIMIT_CORE, &lim) == 0) { | |
1054 | + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, | |
1055 | + "core dump file size limit raised to %lu bytes", | |
1056 | + lim.rlim_cur); | |
1057 | + } else { | |
1058 | + ap_log_error(APLOG_MARK, APLOG_NOTICE, errno, NULL, | |
1059 | + "core dump file size is zero, setrlimit failed"); | |
1060 | + } | |
1061 | + } | |
1062 | + } | |
1063 | +#endif | |
1064 | + | |
1065 | return OK; | |
1066 | } | |
1067 | ||
1068 | diff -ur httpd-2.0.52.org/server/listen.c httpd-2.0.52/server/listen.c | |
1069 | --- httpd-2.0.52.org/server/listen.c 2004-10-01 01:16:29.869351651 +0200 | |
1070 | +++ httpd-2.0.52/server/listen.c 2004-10-01 01:17:32.580917169 +0200 | |
1071 | @@ -122,7 +122,7 @@ | |
1072 | ap_sock_disable_nagle(s); | |
1073 | #endif | |
1074 | ||
1075 | - if ((stat = apr_bind(s, server->bind_addr)) != APR_SUCCESS) { | |
1076 | + if ((stat = apr_socket_bind(s, server->bind_addr)) != APR_SUCCESS) { | |
1077 | ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, stat, p, | |
1078 | "make_sock: could not bind to address %pI", | |
1079 | server->bind_addr); | |
1080 | @@ -130,7 +130,7 @@ | |
1081 | return stat; | |
fa0f2add | 1082 | } |
fa0f2add | 1083 | |
fb7841c8 AM |
1084 | - if ((stat = apr_listen(s, ap_listenbacklog)) != APR_SUCCESS) { |
1085 | + if ((stat = apr_socket_listen(s, ap_listenbacklog)) != APR_SUCCESS) { | |
1086 | ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_ERR, stat, p, | |
1087 | "make_sock: unable to listen for connections " | |
1088 | "on address %pI", | |
1089 | @@ -213,10 +213,10 @@ | |
1090 | apr_socket_t *tmp_sock; | |
1091 | apr_sockaddr_t *sa; | |
1092 | ||
1093 | - if ((sock_rv = apr_socket_create(&tmp_sock, APR_INET6, SOCK_STREAM, p)) | |
1094 | + if ((sock_rv = apr_socket_create(&tmp_sock, APR_INET6, SOCK_STREAM, APR_PROTO_TCP, p)) | |
1095 | == APR_SUCCESS && | |
1096 | apr_sockaddr_info_get(&sa, NULL, APR_INET6, 0, 0, p) == APR_SUCCESS && | |
1097 | - apr_bind(tmp_sock, sa) == APR_SUCCESS) { | |
1098 | + apr_socket_bind(tmp_sock, sa) == APR_SUCCESS) { | |
1099 | default_family = APR_INET6; | |
fa0f2add | 1100 | } |
fb7841c8 AM |
1101 | else { |
1102 | @@ -261,7 +261,7 @@ | |
1103 | sa = (*walk)->bind_addr; | |
1104 | /* Some listeners are not real so they will not have a bind_addr. */ | |
1105 | if (sa) { | |
1106 | - apr_sockaddr_port_get(&oldport, sa); | |
1107 | + oldport = sa->port; | |
1108 | if (!strcmp(sa->hostname, addr) && port == oldport) { | |
1109 | /* re-use existing record */ | |
1110 | new = *walk; | |
1111 | @@ -286,7 +286,7 @@ | |
fa0f2add | 1112 | } |
fb7841c8 AM |
1113 | if ((status = apr_socket_create(&new->sd, |
1114 | new->bind_addr->family, | |
1115 | - SOCK_STREAM, process->pool)) | |
1116 | + SOCK_STREAM, APR_PROTO_TCP, process->pool)) | |
1117 | != APR_SUCCESS) { | |
1118 | ap_log_perror(APLOG_MARK, APLOG_CRIT, status, process->pool, | |
1119 | "alloc_listener: failed to get a socket for %s", addr); | |
1120 | diff -ur httpd-2.0.52.org/server/main.c httpd-2.0.52/server/main.c | |
1121 | --- httpd-2.0.52.org/server/main.c 2004-10-01 01:16:29.748377567 +0200 | |
1122 | +++ httpd-2.0.52/server/main.c 2004-10-01 01:17:32.569919525 +0200 | |
1123 | @@ -238,7 +238,7 @@ | |
1124 | apr_pool_tag(process->pconf, "pconf"); | |
1125 | process->argc = argc; | |
1126 | process->argv = argv; | |
1127 | - process->short_name = apr_filename_of_pathname(argv[0]); | |
1128 | + process->short_name = apr_filepath_name_get(argv[0]); | |
1129 | return process; | |
1130 | } | |
1131 | ||
1132 | diff -ur httpd-2.0.52.org/server/mpm/experimental/metuxmpm/metuxmpm.c httpd-2.0.52/server/mpm/experimental/metuxmpm/metuxmpm.c | |
1133 | --- httpd-2.0.52.org/server/mpm/experimental/metuxmpm/metuxmpm.c 2004-10-01 01:16:29.694389132 +0200 | |
1134 | +++ httpd-2.0.52/server/mpm/experimental/metuxmpm/metuxmpm.c 2004-10-01 01:17:32.561921238 +0200 | |
1135 | @@ -819,7 +819,7 @@ | |
1136 | if (workers_may_exit) return APR_SUCCESS; | |
1137 | ||
1138 | apr_thread_mutex_lock(pipe_of_death_mutex); | |
1139 | - ret = apr_recv(lr->sd, &pipe_read_char, &n); | |
1140 | + ret = apr_socket_recv(lr->sd, &pipe_read_char, &n); | |
1141 | if (APR_STATUS_IS_EAGAIN(ret)) | |
1142 | { | |
1143 | /* It lost the lottery. It must continue to suffer | |
1144 | @@ -975,6 +975,7 @@ | |
1145 | while (!workers_may_exit) | |
1146 | { | |
1147 | apr_int16_t event; | |
1148 | + int ifd; | |
1149 | ||
1150 | _DBG("loop. conn_id=%d req_max=%d req_remain=%d", | |
1151 | conn_id, ap_max_requests_per_child, requests_this_child); | |
1152 | @@ -993,14 +994,18 @@ | |
1153 | ||
1154 | /* -- setup pollset -- */ | |
1155 | /* NOTE: we do _not_ do this upwards anylonger */ | |
1156 | - apr_poll_setup(&pollset, num_listensocks, tpool); | |
1157 | - apr_poll_setup(&pollset, num_listensocks, ptrans); | |
1158 | + pollset = apr_pcalloc(ptrans, sizeof(apr_pollfd_t) * num_listensocks); | |
1159 | + ifd = 0; | |
1160 | for(lr_walk = ap_listeners; lr_walk != NULL; lr_walk = lr_walk->next) | |
1161 | { | |
1162 | int fd; | |
1163 | - apr_poll_socket_add(pollset, lr_walk->sd, APR_POLLIN); | |
1164 | + pollset[ifd].p = ptrans; | |
1165 | + pollset[ifd].desc.s = lr_walk->sd; | |
1166 | + pollset[ifd].desc_type = APR_POLL_SOCKET; | |
1167 | + pollset[ifd].reqevents = APR_POLLIN; | |
1168 | apr_os_sock_get(&fd, lr_walk->sd); | |
1169 | _DBG("adding fd %d to pollset", fd); | |
1170 | + ifd++; | |
fa0f2add | 1171 | } |
fa0f2add | 1172 | |
fb7841c8 AM |
1173 | if (workers_may_exit) goto worker_out; |
1174 | @@ -1032,10 +1037,13 @@ | |
1175 | _DBG("looking for an listener",0); | |
1176 | for (lr_walk=ap_listeners; lr_walk!=NULL; lr_walk = lr_walk->next) | |
1177 | { | |
1178 | - int fd_tmp; | |
1179 | + int fd_tmp, fdt; | |
1180 | apr_os_sock_get(&fd_tmp, lr_walk->sd); | |
1181 | _DBG(" ... trying w/ fd=%d", fd_tmp); | |
1182 | - apr_poll_revents_get(&event, lr_walk->sd, pollset); | |
1183 | + for(fdt = 0; fdt < num_listensocks; fdt++) | |
1184 | + if(pollset[fdt].desc.s == lr_walk->sd) | |
1185 | + break; | |
1186 | + event = pollset[fdt].rtnevents; | |
1187 | if (event & (APR_POLLIN)) | |
1188 | { | |
1189 | THREAD_ACCEPT_UNLOCK; | |
1190 | @@ -1588,7 +1596,7 @@ | |
1191 | } | |
1192 | #if APR_HAS_OTHER_CHILD | |
fa0f2add | 1193 | } |
fb7841c8 AM |
1194 | - else if (apr_proc_other_child_read(&pid, status) == 0) |
1195 | + else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH, status) == 0) | |
1196 | { | |
1197 | /* handled */ | |
1198 | #endif | |
1199 | diff -ur httpd-2.0.52.org/server/mpm/experimental/perchild/perchild.c httpd-2.0.52/server/mpm/experimental/perchild/perchild.c | |
1200 | --- httpd-2.0.52.org/server/mpm/experimental/perchild/perchild.c 2004-10-01 01:16:29.688390417 +0200 | |
1201 | +++ httpd-2.0.52/server/mpm/experimental/perchild/perchild.c 2004-10-01 01:17:32.724886327 +0200 | |
1202 | @@ -552,7 +552,7 @@ | |
1203 | char pipe_read_char; | |
1204 | apr_size_t n = 1; | |
1205 | ||
1206 | - ret = apr_recv(lr->sd, &pipe_read_char, &n); | |
1207 | + ret = apr_socket_recv(lr->sd, &pipe_read_char, &n); | |
1208 | if (APR_STATUS_IS_EAGAIN(ret)) { | |
1209 | /* It lost the lottery. It must continue to suffer | |
1210 | * through a life of servitude. */ | |
1211 | @@ -643,7 +643,7 @@ | |
1212 | apr_pollfd_t *pollset; | |
1213 | apr_status_t rv; | |
1214 | ap_listen_rec *lr, *last_lr = ap_listeners; | |
1215 | - int n; | |
1216 | + int n, ifd; | |
1217 | apr_bucket_alloc_t *bucket_alloc; | |
1218 | ||
1219 | apr_thread_mutex_lock(thread_pool_parent_mutex); | |
1220 | @@ -657,10 +657,15 @@ | |
1221 | ||
1222 | bucket_alloc = apr_bucket_alloc_create(apr_thread_pool_get(thd)); | |
1223 | ||
1224 | - apr_poll_setup(&pollset, num_listensocks, tpool); | |
1225 | + pollset = apr_pcalloc(tpool, sizeof(apr_pollfd_t) * num_listensocks); | |
1226 | + ifd = 0; | |
1227 | for(lr = ap_listeners; lr != NULL; lr = lr->next) { | |
1228 | int fd; | |
1229 | - apr_poll_socket_add(pollset, lr->sd, APR_POLLIN); | |
1230 | + pollset[ifd].p = tpool; | |
1231 | + pollset[ifd].desc.s = lr->sd; | |
1232 | + pollset[ifd].desc_type = APR_POLL_SOCKET; | |
1233 | + pollset[ifd].reqevents = APR_POLLIN; | |
1234 | + ifd++; | |
1235 | ||
1236 | apr_os_sock_get(&fd, lr->sd); | |
fa0f2add | 1237 | } |
fb7841c8 AM |
1238 | @@ -726,7 +731,10 @@ |
1239 | lr = ap_listeners; | |
1240 | } | |
1241 | /* XXX: Should we check for POLLERR? */ | |
1242 | - apr_poll_revents_get(&event, lr->sd, pollset); | |
1243 | + for(ifd = 0; ifd < num_listensocks; ifd++) | |
1244 | + if(pollset[ifd].desc.s == lr->sd) | |
1245 | + break; | |
1246 | + event = pollset[ifd].rtnevents; | |
1247 | if (event & (APR_POLLIN)) { | |
1248 | last_lr = lr; | |
1249 | goto got_fd; | |
1250 | @@ -1170,7 +1178,7 @@ | |
1251 | } | |
1252 | #if APR_HAS_OTHER_CHILD | |
1253 | } | |
1254 | - else if (apr_proc_other_child_read(&pid, status) == 0) { | |
1255 | + else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH, status) == 0) { | |
1256 | /* handled */ | |
1257 | #endif | |
1258 | } | |
1259 | diff -ur httpd-2.0.52.org/server/mpm/experimental/peruser/peruser.c httpd-2.0.52/server/mpm/experimental/peruser/peruser.c | |
1260 | --- httpd-2.0.52.org/server/mpm/experimental/peruser/peruser.c 2004-10-01 01:16:29.712385277 +0200 | |
1261 | +++ httpd-2.0.52/server/mpm/experimental/peruser/peruser.c 2004-10-01 01:17:32.720887183 +0200 | |
1262 | @@ -625,7 +625,7 @@ | |
1263 | if (die_now) return APR_SUCCESS; | |
1264 | ||
1265 | /* apr_thread_mutex_lock(pipe_of_death_mutex); */ | |
1266 | - ret = apr_recv(lr->sd, &pipe_read_char, &n); | |
1267 | + ret = apr_socket_recv(lr->sd, &pipe_read_char, &n); | |
1268 | if (APR_STATUS_IS_EAGAIN(ret)) | |
1269 | { | |
1270 | /* It lost the lottery. It must continue to suffer | |
1271 | @@ -1985,7 +1985,7 @@ | |
1272 | } | |
1273 | #if APR_HAS_OTHER_CHILD | |
1274 | } | |
1275 | - else if (apr_proc_other_child_read(&pid, status) == 0) { | |
1276 | + else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH, status) == 0) { | |
1277 | _DBG("APR_HAS_OTHER_CHILD, apparently", 0); | |
1278 | /* handled */ | |
1279 | #endif | |
1280 | diff -ur httpd-2.0.52.org/server/mpm/prefork/prefork.c httpd-2.0.52/server/mpm/prefork/prefork.c | |
1281 | --- httpd-2.0.52.org/server/mpm/prefork/prefork.c 2004-10-01 01:16:29.731381208 +0200 | |
1282 | +++ httpd-2.0.52/server/mpm/prefork/prefork.c 2004-10-01 01:17:32.727885684 +0200 | |
1283 | @@ -1002,7 +1002,7 @@ | |
1284 | } | |
1285 | #if APR_HAS_OTHER_CHILD | |
1286 | } | |
1287 | - else if (apr_proc_other_child_read(&pid, status) == 0) { | |
1288 | + else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH, status) == 0) { | |
1289 | /* handled */ | |
1290 | #endif | |
1291 | } | |
1292 | diff -ur httpd-2.0.52.org/server/mpm/worker/pod.c httpd-2.0.52/server/mpm/worker/pod.c | |
1293 | --- httpd-2.0.52.org/server/mpm/worker/pod.c 2004-10-01 01:16:29.713385063 +0200 | |
1294 | +++ httpd-2.0.52/server/mpm/worker/pod.c 2004-10-01 01:17:32.729885256 +0200 | |
1295 | @@ -34,8 +34,8 @@ | |
1296 | (*pod)->p = p; | |
1297 | ||
1298 | /* close these before exec. */ | |
1299 | - apr_file_unset_inherit((*pod)->pod_in); | |
1300 | - apr_file_unset_inherit((*pod)->pod_out); | |
1301 | + apr_file_inherit_unset((*pod)->pod_in); | |
1302 | + apr_file_inherit_unset((*pod)->pod_out); | |
1303 | ||
1304 | return APR_SUCCESS; | |
1305 | } | |
1306 | diff -ur httpd-2.0.52.org/server/mpm/worker/worker.c httpd-2.0.52/server/mpm/worker/worker.c | |
1307 | --- httpd-2.0.52.org/server/mpm/worker/worker.c 2004-10-01 01:16:29.715384635 +0200 | |
1308 | +++ httpd-2.0.52/server/mpm/worker/worker.c 2004-10-01 01:17:32.733884399 +0200 | |
1309 | @@ -578,13 +578,19 @@ | |
1310 | apr_pollfd_t *pollset; | |
1311 | apr_status_t rv; | |
1312 | ap_listen_rec *lr, *last_lr = ap_listeners; | |
1313 | - int have_idle_worker = 0; | |
1314 | + int have_idle_worker = 0, ifd; | |
1315 | ||
1316 | free(ti); | |
1317 | ||
1318 | - apr_poll_setup(&pollset, num_listensocks, tpool); | |
1319 | - for(lr = ap_listeners ; lr != NULL ; lr = lr->next) | |
1320 | - apr_poll_socket_add(pollset, lr->sd, APR_POLLIN); | |
1321 | + pollset = apr_pcalloc(tpool, sizeof(apr_pollfd_t) * num_listensocks); | |
1322 | + ifd = 0; | |
1323 | + for(lr = ap_listeners ; lr != NULL ; lr = lr->next) { | |
1324 | + pollset[ifd].p = tpool; | |
1325 | + pollset[ifd].desc.s = lr->sd; | |
1326 | + pollset[ifd].desc_type = APR_POLL_SOCKET; | |
1327 | + pollset[ifd].reqevents = APR_POLLIN; | |
1328 | + ifd++; | |
1329 | + } | |
1330 | ||
1331 | /* Unblock the signal used to wake this thread up, and set a handler for | |
1332 | * it. | |
1333 | @@ -670,7 +676,10 @@ | |
1334 | lr = ap_listeners; | |
1335 | } | |
1336 | /* XXX: Should we check for POLLERR? */ | |
1337 | - apr_poll_revents_get(&event, lr->sd, pollset); | |
1338 | + for(ifd = 0; ifd < num_listensocks; ifd++) | |
1339 | + if(pollset[ifd].desc.s == lr->sd) | |
1340 | + break; | |
1341 | + event = pollset[ifd].rtnevents; | |
1342 | if (event & APR_POLLIN) { | |
1343 | last_lr = lr; | |
1344 | goto got_fd; | |
1345 | @@ -1500,7 +1509,7 @@ | |
1346 | } | |
1347 | #if APR_HAS_OTHER_CHILD | |
1348 | } | |
1349 | - else if (apr_proc_other_child_read(&pid, status) == 0) { | |
1350 | + else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH, status) == 0) { | |
1351 | /* handled */ | |
1352 | #endif | |
1353 | } | |
1354 | diff -ur httpd-2.0.52.org/server/mpm_common.c httpd-2.0.52/server/mpm_common.c | |
1355 | --- httpd-2.0.52.org/server/mpm_common.c 2004-10-01 01:16:29.734380565 +0200 | |
1356 | +++ httpd-2.0.52/server/mpm_common.c 2004-10-01 01:17:32.589915241 +0200 | |
1357 | @@ -150,7 +150,7 @@ | |
1358 | } | |
1359 | ||
1360 | #if APR_HAS_OTHER_CHILD | |
1361 | - apr_proc_other_child_check(); | |
1362 | + apr_proc_other_child_refresh_all(APR_OC_REASON_RESTART); | |
1363 | #endif | |
fa0f2add | 1364 | |
fb7841c8 AM |
1365 | if (!not_dead_yet) { |
1366 | @@ -371,8 +371,8 @@ | |
1367 | APR_UNSPEC, ap_listeners->bind_addr->port, 0, p); | |
fa0f2add | 1368 | |
fb7841c8 AM |
1369 | /* close these before exec. */ |
1370 | - apr_file_unset_inherit((*pod)->pod_in); | |
1371 | - apr_file_unset_inherit((*pod)->pod_out); | |
1372 | + apr_file_inherit_unset((*pod)->pod_in); | |
1373 | + apr_file_inherit_unset((*pod)->pod_out); | |
fa0f2add | 1374 | |
fb7841c8 AM |
1375 | return APR_SUCCESS; |
1376 | } | |
1377 | @@ -445,7 +445,7 @@ | |
1378 | return rv; | |
fa0f2add | 1379 | } |
fa0f2add | 1380 | |
fb7841c8 AM |
1381 | - rv = apr_socket_create(&sock, pod->sa->family, SOCK_STREAM, p); |
1382 | + rv = apr_socket_create(&sock, pod->sa->family, SOCK_STREAM, APR_PROTO_TCP, p); | |
1383 | if (rv != APR_SUCCESS) { | |
1384 | ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, | |
1385 | "get socket to connect to listener"); | |
1386 | @@ -466,7 +466,7 @@ | |
1387 | return rv; | |
fa0f2add | 1388 | } |
fa0f2add | 1389 | |
fb7841c8 AM |
1390 | - rv = apr_connect(sock, pod->sa); |
1391 | + rv = apr_socket_connect(sock, pod->sa); | |
1392 | if (rv != APR_SUCCESS) { | |
1393 | int log_level = APLOG_WARNING; | |
fa0f2add | 1394 | |
fb7841c8 AM |
1395 | diff -ur httpd-2.0.52.org/server/protocol.c httpd-2.0.52/server/protocol.c |
1396 | --- httpd-2.0.52.org/server/protocol.c 2004-10-01 01:16:29.735380351 +0200 | |
1397 | +++ httpd-2.0.52/server/protocol.c 2004-10-01 01:17:32.592914598 +0200 | |
1398 | @@ -223,7 +223,7 @@ | |
1399 | return APR_EGENERAL; | |
1400 | } | |
fa0f2add | 1401 | |
fb7841c8 AM |
1402 | - APR_BRIGADE_FOREACH(e, bb) { |
1403 | + for(e = APR_BRIGADE_FIRST(bb); e != APR_BRIGADE_SENTINEL(bb); e = APR_BUCKET_NEXT(e)) { | |
1404 | const char *str; | |
1405 | apr_size_t len; | |
fa0f2add | 1406 | |
fb7841c8 AM |
1407 | diff -ur httpd-2.0.52.org/server/request.c httpd-2.0.52/server/request.c |
1408 | --- httpd-2.0.52.org/server/request.c 2004-10-01 01:16:29.738379708 +0200 | |
1409 | +++ httpd-2.0.52/server/request.c 2004-10-01 01:17:32.601912671 +0200 | |
1410 | @@ -375,7 +375,7 @@ | |
1411 | * owner of the symlink, then get the info of the target. | |
1412 | */ | |
1413 | if (!(lfi->valid & APR_FINFO_OWNER)) { | |
1414 | - if ((res = apr_lstat(&fi, d, lfi->valid | APR_FINFO_OWNER, p)) | |
1415 | + if ((res = apr_stat(&fi, d, lfi->valid | APR_FINFO_OWNER | APR_FINFO_LINK, p)) | |
1416 | != APR_SUCCESS) { | |
1417 | return HTTP_FORBIDDEN; | |
fa0f2add | 1418 | } |
fb7841c8 AM |
1419 | @@ -386,7 +386,7 @@ |
1420 | return HTTP_FORBIDDEN; | |
fa0f2add | 1421 | } |
fa0f2add | 1422 | |
fb7841c8 AM |
1423 | - if (apr_compare_users(fi.user, lfi->user) != APR_SUCCESS) { |
1424 | + if (apr_uid_compare(fi.user, lfi->user) != APR_SUCCESS) { | |
1425 | return HTTP_FORBIDDEN; | |
1426 | } | |
1427 | ||
1428 | @@ -763,7 +763,7 @@ | |
1429 | && ((entry_core->d_components < seg) | |
1430 | || (entry_core->d_is_fnmatch | |
1431 | ? (apr_fnmatch(entry_core->d, r->filename, | |
1432 | - FNM_PATHNAME) != APR_SUCCESS) | |
1433 | + APR_FNM_PATHNAME) != APR_SUCCESS) | |
1434 | : (strcmp(r->filename, entry_core->d) != 0)))) { | |
1435 | continue; | |
fa0f2add | 1436 | } |
fb7841c8 AM |
1437 | @@ -939,8 +939,8 @@ |
1438 | * want the name of this 'link' object, not the name of its | |
1439 | * target, if we are fixing the filename case/resolving aliases. | |
1440 | */ | |
1441 | - rv = apr_lstat(&thisinfo, r->filename, | |
1442 | - APR_FINFO_MIN | APR_FINFO_NAME, r->pool); | |
1443 | + rv = apr_stat(&thisinfo, r->filename, | |
1444 | + APR_FINFO_MIN | APR_FINFO_NAME | APR_FINFO_LINK, r->pool); | |
fa0f2add | 1445 | |
fb7841c8 AM |
1446 | if (APR_STATUS_IS_ENOENT(rv)) { |
1447 | /* Nothing? That could be nice. But our directory | |
1448 | @@ -1230,7 +1230,7 @@ | |
1449 | if (entry_core->r | |
1450 | ? ap_regexec(entry_core->r, r->uri, 0, NULL, 0) | |
1451 | : (entry_core->d_is_fnmatch | |
1452 | - ? apr_fnmatch(entry_core->d, cache->cached, FNM_PATHNAME) | |
1453 | + ? apr_fnmatch(entry_core->d, cache->cached, APR_FNM_PATHNAME) | |
1454 | : (strncmp(entry_core->d, cache->cached, len) | |
1455 | || (entry_core->d[len - 1] != '/' | |
1456 | && cache->cached[len] != '/' | |
1457 | @@ -1379,7 +1379,7 @@ | |
1458 | if (entry_core->r | |
1459 | ? ap_regexec(entry_core->r, cache->cached , 0, NULL, 0) | |
1460 | : (entry_core->d_is_fnmatch | |
1461 | - ? apr_fnmatch(entry_core->d, cache->cached, FNM_PATHNAME) | |
1462 | + ? apr_fnmatch(entry_core->d, cache->cached, APR_FNM_PATHNAME) | |
1463 | : strcmp(entry_core->d, cache->cached))) { | |
1464 | continue; | |
fa0f2add | 1465 | } |
fb7841c8 | 1466 | @@ -1690,8 +1690,8 @@ |
fa0f2add | 1467 | } |
fb7841c8 AM |
1468 | } |
1469 | else { | |
1470 | - if (((rv = apr_lstat(&rnew->finfo, rnew->filename, | |
1471 | - APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS) | |
1472 | + if (((rv = apr_stat(&rnew->finfo, rnew->filename, | |
1473 | + APR_FINFO_MIN | APR_FINFO_LINK, rnew->pool)) != APR_SUCCESS) | |
1474 | && (rv != APR_INCOMPLETE)) { | |
1475 | rnew->finfo.filetype = 0; | |
1476 | } | |
1477 | @@ -1795,8 +1795,8 @@ | |
1478 | } | |
1479 | } | |
1480 | else { | |
1481 | - if (((rv = apr_lstat(&rnew->finfo, rnew->filename, | |
1482 | - APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS) | |
1483 | + if (((rv = apr_stat(&rnew->finfo, rnew->filename, | |
1484 | + APR_FINFO_MIN | APR_FINFO_LINK, rnew->pool)) != APR_SUCCESS) | |
1485 | && (rv != APR_INCOMPLETE)) { | |
1486 | rnew->finfo.filetype = 0; | |
1487 | } | |
1488 | diff -ur httpd-2.0.52.org/server/rfc1413.c httpd-2.0.52/server/rfc1413.c | |
1489 | --- httpd-2.0.52.org/server/rfc1413.c 2004-10-01 01:16:29.733380779 +0200 | |
1490 | +++ httpd-2.0.52/server/rfc1413.c 2004-10-01 01:17:32.586915883 +0200 | |
1491 | @@ -98,7 +98,7 @@ | |
fa0f2add | 1492 | |
fb7841c8 AM |
1493 | if ((rv = apr_socket_create(newsock, |
1494 | localsa->family, /* has to match */ | |
1495 | - SOCK_STREAM, conn->pool)) != APR_SUCCESS) { | |
1496 | + SOCK_STREAM, APR_PROTO_TCP, conn->pool)) != APR_SUCCESS) { | |
1497 | ap_log_error(APLOG_MARK, APLOG_CRIT, rv, srv, | |
1498 | "rfc1413: error creating query socket"); | |
1499 | return rv; | |
1500 | @@ -121,7 +121,7 @@ | |
1501 | * addresses from the query socket. | |
fa0f2add JB |
1502 | */ |
1503 | ||
fb7841c8 AM |
1504 | - if ((rv = apr_bind(*newsock, localsa)) != APR_SUCCESS) { |
1505 | + if ((rv = apr_socket_bind(*newsock, localsa)) != APR_SUCCESS) { | |
1506 | ap_log_error(APLOG_MARK, APLOG_CRIT, rv, srv, | |
1507 | "rfc1413: Error binding query socket to local port"); | |
1508 | apr_socket_close(*newsock); | |
1509 | @@ -132,7 +132,7 @@ | |
1510 | * errors from connect usually imply the remote machine doesn't support | |
1511 | * the service; don't log such an error | |
1512 | */ | |
1513 | - if ((rv = apr_connect(*newsock, destsa)) != APR_SUCCESS) { | |
1514 | + if ((rv = apr_socket_connect(*newsock, destsa)) != APR_SUCCESS) { | |
1515 | apr_socket_close(*newsock); | |
1516 | return rv; | |
fa0f2add | 1517 | } |
fb7841c8 AM |
1518 | @@ -151,8 +151,8 @@ |
1519 | char user[RFC1413_USERLEN + 1]; /* XXX */ | |
1520 | apr_size_t buflen; | |
fa0f2add | 1521 | |
fb7841c8 AM |
1522 | - apr_sockaddr_port_get(&sav_our_port, conn->local_addr); |
1523 | - apr_sockaddr_port_get(&sav_rmt_port, conn->remote_addr); | |
1524 | + sav_our_port = conn->local_addr->port; | |
1525 | + sav_rmt_port = conn->remote_addr->port; | |
fa0f2add | 1526 | |
fb7841c8 AM |
1527 | /* send the data */ |
1528 | buflen = apr_snprintf(buffer, sizeof(buffer), "%hu,%hu\r\n", sav_rmt_port, | |
1529 | @@ -164,7 +164,7 @@ | |
1530 | while (i < buflen) { | |
1531 | apr_size_t j = strlen(buffer + i); | |
1532 | apr_status_t status; | |
1533 | - status = apr_send(sock, buffer+i, &j); | |
1534 | + status = apr_socket_send(sock, buffer+i, &j); | |
1535 | if (status != APR_SUCCESS) { | |
1536 | ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv, | |
1537 | "write: rfc1413: error sending request"); | |
1538 | @@ -190,7 +190,7 @@ | |
1539 | while((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) { | |
1540 | apr_size_t j = sizeof(buffer) - 1 - i; | |
1541 | apr_status_t status; | |
1542 | - status = apr_recv(sock, buffer+i, &j); | |
1543 | + status = apr_socket_recv(sock, buffer+i, &j); | |
1544 | if (status != APR_SUCCESS) { | |
1545 | ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv, | |
1546 | "read: rfc1413: error reading response"); | |
1547 | diff -ur httpd-2.0.52.org/server/util.c httpd-2.0.52/server/util.c | |
1548 | --- httpd-2.0.52.org/server/util.c 2004-10-01 01:16:29.741379066 +0200 | |
1549 | +++ httpd-2.0.52/server/util.c 2004-10-01 01:17:32.584916312 +0200 | |
1550 | @@ -1916,7 +1916,7 @@ | |
fa0f2add | 1551 | { |
fb7841c8 | 1552 | apr_finfo_t finfo; |
fa0f2add | 1553 | |
fb7841c8 AM |
1554 | - if (apr_lstat(&finfo, path, APR_FINFO_TYPE, p) != APR_SUCCESS) |
1555 | + if (apr_stat(&finfo, path, APR_FINFO_TYPE | APR_FINFO_LINK, p) != APR_SUCCESS) | |
1556 | return 0; /* in error condition, just return no */ | |
fa0f2add | 1557 | |
fb7841c8 AM |
1558 | return (finfo.filetype == APR_DIR); |
1559 | Tylko w httpd-2.0.52/server: util.c.orig | |
1560 | diff -ur httpd-2.0.52.org/server/util_filter.c httpd-2.0.52/server/util_filter.c | |
1561 | --- httpd-2.0.52.org/server/util_filter.c 2004-10-01 01:16:29.737379923 +0200 | |
1562 | +++ httpd-2.0.52/server/util_filter.c 2004-10-01 01:17:32.597913528 +0200 | |
1563 | @@ -527,7 +527,7 @@ | |
1564 | *saveto = apr_brigade_create(p, f->c->bucket_alloc); | |
fa0f2add | 1565 | } |
fb7841c8 AM |
1566 | |
1567 | - APR_RING_FOREACH(e, &(*b)->list, apr_bucket, link) { | |
1568 | + for(e = APR_RING_FIRST(&(*b)->list); e != APR_RING_SENTINEL(&(*b)->list, apr_bucket, link); e = APR_RING_NEXT(e, link)) { | |
1569 | rv = apr_bucket_setaside(e, p); | |
1570 | if (rv != APR_SUCCESS | |
1571 | /* ### this ENOTIMPL will go away once we implement setaside | |
1572 | diff -ur httpd-2.0.52.org/server/util_md5.c httpd-2.0.52/server/util_md5.c | |
1573 | --- httpd-2.0.52.org/server/util_md5.c 2004-10-01 01:16:29.750377138 +0200 | |
1574 | +++ httpd-2.0.52/server/util_md5.c 2004-10-01 01:17:32.570919310 +0200 | |
1575 | @@ -53,8 +53,8 @@ | |
1576 | { | |
1577 | const char *hex = "0123456789abcdef"; | |
1578 | apr_md5_ctx_t my_md5; | |
1579 | - unsigned char hash[MD5_DIGESTSIZE]; | |
1580 | - char *r, result[33]; /* (MD5_DIGESTSIZE * 2) + 1 */ | |
1581 | + unsigned char hash[APR_MD5_DIGESTSIZE]; | |
1582 | + char *r, result[33]; /* (APR_MD5_DIGESTSIZE * 2) + 1 */ | |
1583 | int i; | |
fa0f2add | 1584 | |
fb7841c8 AM |
1585 | /* |
1586 | @@ -68,13 +68,13 @@ | |
1587 | apr_md5_update(&my_md5, buf, (unsigned int)length); | |
1588 | apr_md5_final(hash, &my_md5); | |
fa0f2add | 1589 | |
fb7841c8 AM |
1590 | - for (i = 0, r = result; i < MD5_DIGESTSIZE; i++) { |
1591 | + for (i = 0, r = result; i < APR_MD5_DIGESTSIZE; i++) { | |
1592 | *r++ = hex[hash[i] >> 4]; | |
1593 | *r++ = hex[hash[i] & 0xF]; | |
fa0f2add | 1594 | } |
fb7841c8 | 1595 | *r = '\0'; |
fa0f2add | 1596 | |
fb7841c8 AM |
1597 | - return apr_pstrndup(p, result, MD5_DIGESTSIZE*2); |
1598 | + return apr_pstrndup(p, result, APR_MD5_DIGESTSIZE*2); | |
1599 | } | |
fa0f2add | 1600 | |
fb7841c8 AM |
1601 | AP_DECLARE(char *) ap_md5(apr_pool_t *p, const unsigned char *string) |
1602 | diff -ur httpd-2.0.52.org/server/util_script.c httpd-2.0.52/server/util_script.c | |
1603 | --- httpd-2.0.52.org/server/util_script.c 2004-10-01 01:16:29.747377781 +0200 | |
1604 | +++ httpd-2.0.52/server/util_script.c 2004-10-01 01:17:32.567919953 +0200 | |
1605 | @@ -236,7 +236,7 @@ | |
1606 | apr_table_addn(e, "SERVER_ADMIN", s->server_admin); /* Apache */ | |
1607 | apr_table_addn(e, "SCRIPT_FILENAME", r->filename); /* Apache */ | |
fa0f2add | 1608 | |
fb7841c8 AM |
1609 | - apr_sockaddr_port_get(&rport, c->remote_addr); |
1610 | + rport = c->remote_addr->port; | |
1611 | apr_table_addn(e, "REMOTE_PORT", apr_itoa(r->pool, rport)); | |
1612 | ||
1613 | if (r->user) { | |
1614 | @@ -425,7 +425,7 @@ | |
1615 | if ((*getsfunc) (w, MAX_STRING_LEN - 1, getsfunc_data) == 0) { | |
1616 | ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, 0, r, | |
1617 | "Premature end of script headers: %s", | |
fa0f2add JB |
1618 | - apr_filename_of_pathname(r->filename)); |
1619 | + apr_filepath_name_get(r->filename)); | |
fb7841c8 AM |
1620 | return HTTP_INTERNAL_SERVER_ERROR; |
1621 | } | |
fa0f2add | 1622 | |
fb7841c8 | 1623 | @@ -518,7 +518,7 @@ |
fa0f2add | 1624 | |
fb7841c8 AM |
1625 | ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, 0, r, |
1626 | "%s: %s", malformed, | |
1627 | - apr_filename_of_pathname(r->filename)); | |
1628 | + apr_filepath_name_get(r->filename)); | |
1629 | return HTTP_INTERNAL_SERVER_ERROR; | |
1630 | } | |
fa0f2add | 1631 | |
fb7841c8 | 1632 | @@ -609,7 +609,7 @@ |
fa0f2add | 1633 | |
fb7841c8 AM |
1634 | rv = apr_bucket_read(e, &bucket_data, &bucket_data_len, |
1635 | APR_BLOCK_READ); | |
1636 | - if (!APR_STATUS_IS_SUCCESS(rv) || (bucket_data_len == 0)) { | |
1637 | + if ((rv != APR_SUCCESS) || (bucket_data_len == 0)) { | |
1638 | return 0; | |
fa0f2add | 1639 | } |
fb7841c8 AM |
1640 | src = bucket_data; |
1641 | diff -ur httpd-2.0.52.org/server/util_time.c httpd-2.0.52/server/util_time.c | |
1642 | --- httpd-2.0.52.org/server/util_time.c 2004-10-01 01:16:29.739379494 +0200 | |
1643 | +++ httpd-2.0.52/server/util_time.c 2004-10-01 01:17:32.604912028 +0200 | |
1644 | @@ -118,7 +118,7 @@ | |
1645 | else { | |
1646 | r = apr_time_exp_lt(xt, t); | |
fa0f2add | 1647 | } |
fb7841c8 AM |
1648 | - if (!APR_STATUS_IS_SUCCESS(r)) { |
1649 | + if (r != APR_SUCCESS) { | |
1650 | return r; | |
fa0f2add | 1651 | } |
fb7841c8 AM |
1652 | cache_element->t = seconds; |
1653 | diff -ur httpd-2.0.52.org/server/util_xml.c httpd-2.0.52/server/util_xml.c | |
1654 | --- httpd-2.0.52.org/server/util_xml.c 2004-10-01 01:16:29.740379280 +0200 | |
1655 | +++ httpd-2.0.52/server/util_xml.c 2004-10-01 01:17:32.594914170 +0200 | |
1656 | @@ -56,7 +56,7 @@ | |
1657 | goto read_error; | |
fa0f2add | 1658 | } |
fb7841c8 AM |
1659 | |
1660 | - APR_BRIGADE_FOREACH(bucket, brigade) { | |
1661 | + for(bucket = APR_BRIGADE_FIRST(brigade); bucket != APR_BRIGADE_SENTINEL(brigade); bucket = APR_BUCKET_NEXT(bucket)) { | |
fa0f2add JB |
1662 | const char *data; |
1663 | apr_size_t len; | |
1664 | ||
fb7841c8 AM |
1665 | diff -ur httpd-2.0.52.org/server/vhost.c httpd-2.0.52/server/vhost.c |
1666 | --- httpd-2.0.52.org/server/vhost.c 2004-10-01 01:16:29.742378852 +0200 | |
1667 | +++ httpd-2.0.52/server/vhost.c 2004-10-01 01:17:32.607911386 +0200 | |
1668 | @@ -873,7 +873,7 @@ | |
fa0f2add | 1669 | |
fb7841c8 | 1670 | last_s = NULL; |
fa0f2add | 1671 | |
fb7841c8 AM |
1672 | - apr_sockaddr_port_get(&port, r->connection->local_addr); |
1673 | + port = r->connection->local_addr->port; | |
fa0f2add | 1674 | |
fb7841c8 AM |
1675 | /* Recall that the name_chain is a list of server_addr_recs, some of |
1676 | * whose ports may not match. Also each server may appear more than | |
1677 | @@ -929,7 +929,7 @@ | |
1678 | name_chain *src; | |
1679 | apr_port_t port; | |
fa0f2add | 1680 | |
fb7841c8 AM |
1681 | - apr_sockaddr_port_get(&port, r->connection->local_addr); |
1682 | + port = r->connection->local_addr->port; | |
fa0f2add | 1683 | |
fb7841c8 AM |
1684 | /* |
1685 | * This is in conjunction with the ServerPath code in http_core, so we | |
1686 | @@ -1004,7 +1004,7 @@ | |
1687 | /* maybe there's a default server or wildcard name-based vhost | |
1688 | * matching this port | |
1689 | */ | |
1690 | - apr_sockaddr_port_get(&port, conn->local_addr); | |
1691 | + port = conn->local_addr->port; | |
fa0f2add | 1692 | |
fb7841c8 AM |
1693 | trav = find_default_server(port); |
1694 | if (trav) { | |
1695 | diff -ur httpd-2.0.52.org/support/ab.c httpd-2.0.52/support/ab.c | |
1696 | --- httpd-2.0.52.org/support/ab.c 2004-10-01 01:16:32.364817056 +0200 | |
1697 | +++ httpd-2.0.52/support/ab.c 2004-10-01 01:17:32.620908601 +0200 | |
1698 | @@ -721,7 +721,7 @@ | |
1699 | } | |
1700 | else | |
1701 | #endif | |
1702 | - e = apr_send(c->aprsock, request + c->rwrote, &l); | |
1703 | + e = apr_socket_send(c->aprsock, request + c->rwrote, &l); | |
fa0f2add | 1704 | |
fb7841c8 AM |
1705 | /* |
1706 | * Bail early on the most common case | |
1707 | @@ -1204,7 +1204,7 @@ | |
1708 | apr_pool_create(&c->ctx, cntxt); | |
fa0f2add | 1709 | |
fb7841c8 AM |
1710 | if ((rv = apr_socket_create(&c->aprsock, destsa->family, |
1711 | - SOCK_STREAM, c->ctx)) != APR_SUCCESS) { | |
1712 | + SOCK_STREAM, APR_PROTO_TCP, c->ctx)) != APR_SUCCESS) { | |
1713 | apr_err("socket", rv); | |
fa0f2add | 1714 | } |
fb7841c8 AM |
1715 | if ((rv = apr_socket_opt_set(c->aprsock, APR_SO_NONBLOCK, 1)) |
1716 | @@ -1212,7 +1212,7 @@ | |
1717 | apr_err("socket nonblock", rv); | |
1718 | } | |
1719 | c->start = apr_time_now(); | |
1720 | - if ((rv = apr_connect(c->aprsock, destsa)) != APR_SUCCESS) { | |
1721 | + if ((rv = apr_socket_connect(c->aprsock, destsa)) != APR_SUCCESS) { | |
1722 | if (APR_STATUS_IS_EINPROGRESS(rv)) { | |
1723 | apr_pollfd_t new_pollfd; | |
1724 | c->state = STATE_CONNECTING; | |
1725 | @@ -1234,7 +1234,7 @@ | |
1726 | if (bad++ > 10) { | |
1727 | fprintf(stderr, | |
1728 | "\nTest aborted after 10 failures\n\n"); | |
1729 | - apr_err("apr_connect()", rv); | |
1730 | + apr_err("apr_socket_connect()", rv); | |
fa0f2add | 1731 | } |
fb7841c8 AM |
1732 | c->state = STATE_UNCONNECTED; |
1733 | start_connect(c); | |
1734 | @@ -1334,7 +1334,7 @@ | |
1735 | } | |
1736 | else { | |
fa0f2add | 1737 | #endif |
fb7841c8 AM |
1738 | - status = apr_recv(c->aprsock, buffer, &r); |
1739 | + status = apr_socket_recv(c->aprsock, buffer, &r); | |
1740 | if (APR_STATUS_IS_EAGAIN(status)) | |
1741 | return; | |
1742 | else if (r == 0 && APR_STATUS_IS_EOF(status)) { | |
1743 | @@ -1342,12 +1342,12 @@ | |
1744 | close_connection(c); | |
1745 | return; | |
1746 | } | |
1747 | - /* catch legitimate fatal apr_recv errors */ | |
1748 | + /* catch legitimate fatal apr_socket_recv errors */ | |
1749 | else if (status != APR_SUCCESS) { | |
1750 | err_except++; /* XXX: is this the right error counter? */ | |
1751 | /* XXX: Should errors here be fatal, or should we allow a | |
1752 | * certain number of them before completely failing? -aaron */ | |
1753 | - apr_err("apr_recv", status); | |
1754 | + apr_err("apr_socket_recv", status); | |
1755 | } | |
1756 | #ifdef USE_SSL | |
1757 | } | |
1758 | @@ -1708,7 +1708,7 @@ | |
1759 | if (rv & APR_POLLOUT) { | |
1760 | if (c->state == STATE_CONNECTING) { | |
1761 | apr_pollfd_t remove_pollfd; | |
1762 | - rv = apr_connect(c->aprsock, destsa); | |
1763 | + rv = apr_socket_connect(c->aprsock, destsa); | |
1764 | remove_pollfd.desc_type = APR_POLL_SOCKET; | |
1765 | remove_pollfd.desc.s = c->aprsock; | |
1766 | apr_pollset_remove(readbits, &remove_pollfd); | |
1767 | @@ -1718,7 +1718,7 @@ | |
1768 | if (bad++ > 10) { | |
1769 | fprintf(stderr, | |
1770 | "\nTest aborted after 10 failures\n\n"); | |
1771 | - apr_err("apr_connect()", rv); | |
1772 | + apr_err("apr_socket_connect()", rv); | |
1773 | } | |
1774 | c->state = STATE_UNCONNECTED; | |
1775 | start_connect(c); | |
1776 | diff -ur httpd-2.0.52.org/support/Makefile.in httpd-2.0.52/support/Makefile.in | |
1777 | --- httpd-2.0.52.org/support/Makefile.in 2004-10-01 01:16:32.535780431 +0200 | |
1778 | +++ httpd-2.0.52/support/Makefile.in 2004-10-01 01:17:32.616909458 +0200 | |
1779 | @@ -51,7 +51,7 @@ | |
fa0f2add | 1780 | |
fb7841c8 AM |
1781 | ab_OBJECTS = ab.lo |
1782 | ab: $(ab_OBJECTS) | |
1783 | - $(LINK) $(ab_LTFLAGS) $(ab_OBJECTS) $(PROGRAM_LDADD) | |
1784 | + $(LINK) $(ab_LTFLAGS) $(ab_OBJECTS) $(PROGRAM_LDADD) -lm | |
fa0f2add | 1785 | |
fb7841c8 AM |
1786 | checkgid_OBJECTS = checkgid.lo |
1787 | checkgid: $(checkgid_OBJECTS) |