1 Index: modules/http2/h2_bucket_beam.c
2 ===================================================================
3 --- modules/http2/h2_bucket_beam.c (revision 1804645)
4 +++ modules/http2/h2_bucket_beam.c (working copy)
8 else if (APR_BUCKET_IS_FILE(b)) {
9 - /* if unread, has no real mem footprint. how to test? */
10 + /* if unread, has no real mem footprint. */
18 -static apr_status_t wait_cond(h2_bucket_beam *beam, apr_thread_mutex_t *lock)
19 +static int buffer_is_empty(h2_bucket_beam *beam)
21 - if (beam->timeout > 0) {
22 - return apr_thread_cond_timedwait(beam->cond, lock, beam->timeout);
23 + return ((!beam->recv_buffer || APR_BRIGADE_EMPTY(beam->recv_buffer))
24 + && H2_BLIST_EMPTY(&beam->send_list));
27 +static apr_status_t wait_empty(h2_bucket_beam *beam, apr_read_type_e block,
28 + apr_thread_mutex_t *lock)
30 + apr_status_t rv = APR_SUCCESS;
32 + while (!buffer_is_empty(beam) && APR_SUCCESS == rv) {
33 + if (APR_BLOCK_READ != block || !lock) {
36 + else if (beam->timeout > 0) {
37 + rv = apr_thread_cond_timedwait(beam->change, lock, beam->timeout);
40 + rv = apr_thread_cond_wait(beam->change, lock);
44 - return apr_thread_cond_wait(beam->cond, lock);
48 +static apr_status_t wait_not_empty(h2_bucket_beam *beam, apr_read_type_e block,
49 + apr_thread_mutex_t *lock)
51 + apr_status_t rv = APR_SUCCESS;
53 + while (buffer_is_empty(beam) && APR_SUCCESS == rv) {
54 + if (beam->aborted) {
55 + rv = APR_ECONNABORTED;
57 + else if (beam->closed) {
60 + else if (APR_BLOCK_READ != block || !lock) {
63 + else if (beam->timeout > 0) {
64 + rv = apr_thread_cond_timedwait(beam->change, lock, beam->timeout);
67 + rv = apr_thread_cond_wait(beam->change, lock);
73 -static apr_status_t r_wait_space(h2_bucket_beam *beam, apr_read_type_e block,
74 - h2_beam_lock *pbl, apr_size_t *premain)
75 +static apr_status_t wait_not_full(h2_bucket_beam *beam, apr_read_type_e block,
76 + apr_size_t *pspace_left, h2_beam_lock *bl)
78 - *premain = calc_space_left(beam);
79 - while (!beam->aborted && *premain <= 0
80 - && (block == APR_BLOCK_READ) && pbl->mutex) {
81 - apr_status_t status;
82 - report_prod_io(beam, 1, pbl);
83 - status = wait_cond(beam, pbl->mutex);
84 - if (APR_STATUS_IS_TIMEUP(status)) {
86 + apr_status_t rv = APR_SUCCESS;
89 + while (0 == (left = calc_space_left(beam)) && APR_SUCCESS == rv) {
90 + if (beam->aborted) {
91 + rv = APR_ECONNABORTED;
94 - *premain = calc_space_left(beam);
95 + else if (block != APR_BLOCK_READ || !bl->mutex) {
99 + if (beam->timeout > 0) {
100 + rv = apr_thread_cond_timedwait(beam->change, bl->mutex, beam->timeout);
103 + rv = apr_thread_cond_wait(beam->change, bl->mutex);
107 - return beam->aborted? APR_ECONNABORTED : APR_SUCCESS;
108 + *pspace_left = left;
112 static void h2_beam_emitted(h2_bucket_beam *beam, h2_beam_proxy *proxy)
117 - else if (beam->cond) {
118 - apr_thread_cond_broadcast(beam->cond);
120 + apr_thread_cond_broadcast(beam->change);
122 leave_yellow(beam, &bl);
129 - apr_thread_cond_broadcast(beam->cond);
131 + apr_thread_cond_broadcast(beam->change);
136 apr_interval_time_t timeout)
138 h2_bucket_beam *beam;
139 - apr_status_t status = APR_SUCCESS;
140 + apr_status_t rv = APR_SUCCESS;
142 beam = apr_pcalloc(pool, sizeof(*beam));
144 @@ -601,16 +647,15 @@
145 beam->max_buf_size = max_buf_size;
146 beam->timeout = timeout;
148 - status = apr_thread_mutex_create(&beam->lock, APR_THREAD_MUTEX_DEFAULT,
150 - if (status == APR_SUCCESS) {
151 - status = apr_thread_cond_create(&beam->cond, pool);
152 - if (status == APR_SUCCESS) {
153 + rv = apr_thread_mutex_create(&beam->lock, APR_THREAD_MUTEX_DEFAULT, pool);
154 + if (APR_SUCCESS == rv) {
155 + rv = apr_thread_cond_create(&beam->change, pool);
156 + if (APR_SUCCESS == rv) {
157 apr_pool_pre_cleanup_register(pool, beam, beam_cleanup);
165 void h2_beam_buffer_size_set(h2_bucket_beam *beam, apr_size_t buffer_size)
167 h2_blist_cleanup(&beam->send_list);
168 report_consumption(beam, &bl);
171 - apr_thread_cond_broadcast(beam->cond);
173 + apr_thread_cond_broadcast(beam->change);
174 leave_yellow(beam, &bl);
180 if ((status = enter_yellow(beam, &bl)) == APR_SUCCESS) {
181 - while (status == APR_SUCCESS
182 - && !H2_BLIST_EMPTY(&beam->send_list)
183 - && !H2_BPROXY_LIST_EMPTY(&beam->proxies)) {
184 - if (block == APR_NONBLOCK_READ || !bl.mutex) {
185 - status = APR_EAGAIN;
189 - apr_thread_cond_broadcast(beam->cond);
191 - status = wait_cond(beam, bl.mutex);
193 + status = wait_empty(beam, block, bl.mutex);
194 leave_yellow(beam, &bl);
197 @@ -761,13 +793,18 @@
198 static apr_status_t append_bucket(h2_bucket_beam *beam,
200 apr_read_type_e block,
201 + apr_size_t *pspace_left,
206 - apr_size_t space_left = 0;
208 + int can_beam, check_len;
210 + if (beam->aborted) {
211 + return APR_ECONNABORTED;
214 if (APR_BUCKET_IS_METADATA(b)) {
215 if (APR_BUCKET_IS_EOS(b)) {
217 @@ -777,11 +814,31 @@
220 else if (APR_BUCKET_IS_FILE(b)) {
221 - /* file bucket lengths do not really count */
222 + /* For file buckets the problem is their internal readpool that
223 + * is used on the first read to allocate buffer/mmap.
224 + * Since setting aside a file bucket will de-register the
225 + * file cleanup function from the previous pool, we need to
226 + * call that only from the sender thread.
228 + * Currently, we do not handle file bucket with refcount > 1 as
229 + * the beam is then not in complete control of the file's lifetime.
230 + * Which results in the bug that a file get closed by the receiver
231 + * while the sender or the beam still have buckets using it.
233 + * Additionally, we allow callbacks to prevent beaming file
234 + * handles across. The use case for this is to limit the number
235 + * of open file handles and rather use a less efficient beam
237 + apr_bucket_file *bf = b->data;
238 + apr_file_t *fd = bf->fd;
239 + can_beam = (bf->refcount.refcount == 1);
240 + if (can_beam && beam->can_beam_fn) {
241 + can_beam = beam->can_beam_fn(beam->can_beam_ctx, beam, fd);
243 + check_len = !can_beam;
246 - space_left = calc_space_left(beam);
247 - if (space_left > 0 && b->length == ((apr_size_t)-1)) {
248 + if (b->length == ((apr_size_t)-1)) {
250 status = apr_bucket_read(b, &data, &len, APR_BLOCK_READ);
251 if (status != APR_SUCCESS) {
252 @@ -788,19 +845,15 @@
257 - if (space_left <= 0) {
258 - status = r_wait_space(beam, block, pbl, &space_left);
259 - if (status != APR_SUCCESS) {
262 - if (space_left <= 0) {
269 + if (b->length > *pspace_left) {
270 + apr_bucket_split(b, *pspace_left);
272 - /* space available, maybe need bucket split */
273 + *pspace_left -= b->length;
277 /* The fundamental problem is that reading a sender bucket from
278 * a receiver thread is a total NO GO, because the bucket might use
280 apr_bucket_heap_make(b, data, len, NULL);
283 - else if (APR_BUCKET_IS_FILE(b)) {
284 - /* For file buckets the problem is their internal readpool that
285 - * is used on the first read to allocate buffer/mmap.
286 - * Since setting aside a file bucket will de-register the
287 - * file cleanup function from the previous pool, we need to
288 - * call that only from the sender thread.
290 - * Currently, we do not handle file bucket with refcount > 1 as
291 - * the beam is then not in complete control of the file's lifetime.
292 - * Which results in the bug that a file get closed by the receiver
293 - * while the sender or the beam still have buckets using it.
295 - * Additionally, we allow callbacks to prevent beaming file
296 - * handles across. The use case for this is to limit the number
297 - * of open file handles and rather use a less efficient beam
299 - apr_bucket_file *bf = b->data;
300 - apr_file_t *fd = bf->fd;
301 - int can_beam = (bf->refcount.refcount == 1);
302 - if (can_beam && beam->can_beam_fn) {
303 - can_beam = beam->can_beam_fn(beam->can_beam_ctx, beam, fd);
306 - status = apr_bucket_setaside(b, beam->send_pool);
308 - /* else: enter ENOTIMPL case below */
309 + else if (APR_BUCKET_IS_FILE(b) && can_beam) {
310 + status = apr_bucket_setaside(b, beam->send_pool);
313 if (status == APR_ENOTIMPL) {
315 * a counter example).
316 * We do the read while in the sender thread, so that the bucket may
317 * use pools/allocators safely. */
318 - if (space_left < APR_BUCKET_BUFF_SIZE) {
319 - space_left = APR_BUCKET_BUFF_SIZE;
321 - if (space_left < b->length) {
322 - apr_bucket_split(b, space_left);
324 status = apr_bucket_read(b, &data, &len, APR_BLOCK_READ);
325 if (status == APR_SUCCESS) {
326 status = apr_bucket_setaside(b, beam->send_pool);
328 APR_BUCKET_REMOVE(b);
329 H2_BLIST_INSERT_TAIL(&beam->send_list, b);
330 beam->sent_bytes += b->length;
337 apr_read_type_e block)
340 - apr_status_t status = APR_SUCCESS;
341 + apr_status_t rv = APR_SUCCESS;
342 + apr_size_t space_left = 0;
345 /* Called from the sender thread to add buckets to the beam */
346 @@ -914,23 +938,31 @@
349 move_to_hold(beam, sender_bb);
350 - status = APR_ECONNABORTED;
351 + rv = APR_ECONNABORTED;
353 else if (sender_bb) {
354 - int force_report = !APR_BRIGADE_EMPTY(sender_bb);
355 - while (!APR_BRIGADE_EMPTY(sender_bb) && status == APR_SUCCESS) {
356 + int force_report = !APR_BRIGADE_EMPTY(sender_bb);
358 + space_left = calc_space_left(beam);
359 + while (!APR_BRIGADE_EMPTY(sender_bb) && APR_SUCCESS == rv) {
360 + if (space_left <= 0) {
361 + report_prod_io(beam, force_report, &bl);
362 + rv = wait_not_full(beam, block, &space_left, &bl);
363 + if (APR_SUCCESS != rv) {
367 b = APR_BRIGADE_FIRST(sender_bb);
368 - status = append_bucket(beam, b, block, &bl);
369 + rv = append_bucket(beam, b, block, &space_left, &bl);
372 report_prod_io(beam, force_report, &bl);
374 - apr_thread_cond_broadcast(beam->cond);
376 + apr_thread_cond_broadcast(beam->change);
378 report_consumption(beam, &bl);
379 leave_yellow(beam, &bl);
385 apr_status_t h2_beam_receive(h2_bucket_beam *beam,
386 @@ -942,11 +974,16 @@
387 apr_bucket *bsender, *brecv, *ng;
389 apr_status_t status = APR_SUCCESS;
390 - apr_off_t remain = readbytes;
392 int transferred_buckets = 0;
394 /* Called from the receiver thread to take buckets from the beam */
395 if (enter_yellow(beam, &bl) == APR_SUCCESS) {
396 + if (readbytes <= 0) {
397 + readbytes = APR_SIZE_MAX;
399 + remain = readbytes;
403 recv_buffer_cleanup(beam, &bl);
404 @@ -955,11 +992,12 @@
407 /* transfer enough buckets from our receiver brigade, if we have one */
408 - while (beam->recv_buffer
409 - && !APR_BRIGADE_EMPTY(beam->recv_buffer)
410 - && (readbytes <= 0 || remain >= 0)) {
412 + && beam->recv_buffer
413 + && !APR_BRIGADE_EMPTY(beam->recv_buffer)) {
415 brecv = APR_BRIGADE_FIRST(beam->recv_buffer);
416 - if (readbytes > 0 && brecv->length > 0 && remain <= 0) {
417 + if (brecv->length > 0 && remain <= 0) {
420 APR_BUCKET_REMOVE(brecv);
421 @@ -970,11 +1008,11 @@
423 /* transfer from our sender brigade, transforming sender buckets to
424 * receiver ones until we have enough */
425 - while (!H2_BLIST_EMPTY(&beam->send_list) && (readbytes <= 0 || remain >= 0)) {
426 - bsender = H2_BLIST_FIRST(&beam->send_list);
427 + while (remain >= 0 && !H2_BLIST_EMPTY(&beam->send_list)) {
431 - if (readbytes > 0 && bsender->length > 0 && remain <= 0) {
432 + bsender = H2_BLIST_FIRST(&beam->send_list);
433 + if (bsender->length > 0 && remain <= 0) {
437 @@ -1020,11 +1058,12 @@
438 * been handed out. See also PR 59348 */
439 apr_bucket_file_enable_mmap(ng, 0);
441 - remain -= bsender->length;
443 APR_BUCKET_REMOVE(bsender);
444 H2_BLIST_INSERT_TAIL(&beam->hold_list, bsender);
446 + remain -= bsender->length;
448 + ++transferred_buckets;
452 @@ -1041,6 +1080,7 @@
453 * receiver bucket references it any more. */
454 APR_BUCKET_REMOVE(bsender);
455 H2_BLIST_INSERT_TAIL(&beam->hold_list, bsender);
457 beam->received_bytes += bsender->length;
458 ++transferred_buckets;
460 @@ -1063,8 +1103,8 @@
464 - if (readbytes > 0 && remain < 0) {
465 - /* too much, put some back */
467 + /* too much, put some back into out recv_buffer */
469 for (brecv = APR_BRIGADE_FIRST(bb);
470 brecv != APR_BRIGADE_SENTINEL(bb);
471 @@ -1081,15 +1121,7 @@
475 - if (transferred_buckets > 0) {
476 - if (beam->cons_ev_cb) {
477 - beam->cons_ev_cb(beam->cons_ctx, beam);
482 - && (!beam->recv_buffer || APR_BRIGADE_EMPTY(beam->recv_buffer))
483 - && H2_BLIST_EMPTY(&beam->send_list)) {
484 + if (beam->closed && buffer_is_empty(beam)) {
485 /* beam is closed and we have nothing more to receive */
486 if (!beam->close_sent) {
487 apr_bucket *b = apr_bucket_eos_create(bb->bucket_alloc);
488 @@ -1100,28 +1132,23 @@
492 + if (transferred_buckets > 0) {
493 + if (beam->cons_ev_cb) {
494 + beam->cons_ev_cb(beam->cons_ctx, beam);
500 - apr_thread_cond_broadcast(beam->cond);
502 + apr_thread_cond_broadcast(beam->change);
503 status = APR_SUCCESS;
505 - else if (beam->closed) {
508 - else if (block == APR_BLOCK_READ && bl.mutex && beam->cond) {
509 - status = wait_cond(beam, bl.mutex);
511 + status = wait_not_empty(beam, block, bl.mutex);
512 if (status != APR_SUCCESS) {
519 - apr_thread_cond_broadcast(beam->cond);
521 - status = APR_EAGAIN;
524 leave_yellow(beam, &bl);
526 Index: modules/http2/h2_bucket_beam.h
527 ===================================================================
528 --- modules/http2/h2_bucket_beam.h (revision 1804645)
529 +++ modules/http2/h2_bucket_beam.h (working copy)
531 unsigned int tx_mem_limits : 1; /* only memory size counts on transfers */
533 struct apr_thread_mutex_t *lock;
534 - struct apr_thread_cond_t *cond;
535 + struct apr_thread_cond_t *change;
537 h2_beam_mutex_enter *m_enter;
539 Index: modules/http2/h2_stream.c
540 ===================================================================
541 --- modules/http2/h2_stream.c (revision 1804645)
542 +++ modules/http2/h2_stream.c (working copy)
543 @@ -774,20 +774,20 @@
547 -static apr_status_t add_data(h2_stream *stream, apr_off_t requested,
548 - apr_off_t *plen, int *peos, int *complete,
549 - h2_headers **pheaders)
550 +static apr_status_t add_buffered_data(h2_stream *stream, apr_off_t requested,
551 + apr_off_t *plen, int *peos, int *is_all,
552 + h2_headers **pheaders)
564 - H2_STREAM_OUT_LOG(APLOG_TRACE2, stream, "add_data");
565 + H2_STREAM_OUT_LOG(APLOG_TRACE2, stream, "add_buffered_data");
566 b = APR_BRIGADE_FIRST(stream->out_buffer);
567 while (b != APR_BRIGADE_SENTINEL(stream->out_buffer)) {
568 e = APR_BUCKET_NEXT(b);
579 requested = (*plen > 0)? H2MIN(*plen, max_chunk) : max_chunk;
581 /* count the buffered data until eos or a headers bucket */
582 - status = add_data(stream, requested, plen, peos, &complete, pheaders);
583 + status = add_buffered_data(stream, requested, plen, peos, &complete, pheaders);
585 if (status == APR_EAGAIN) {
586 /* TODO: ugly, someone needs to retrieve the response first */
587 @@ -882,29 +882,39 @@
591 + /* If there we do not have enough buffered data to satisfy the requested
592 + * length *and* we counted the _complete_ buffer (and did not stop in the middle
593 + * because of meta data there), lets see if we can read more from the
595 missing = H2MIN(requested, stream->max_mem) - *plen;
596 if (complete && !*peos && missing > 0) {
597 + apr_status_t rv = APR_EOF;
599 if (stream->output) {
600 H2_STREAM_OUT_LOG(APLOG_TRACE2, stream, "pre");
601 - status = h2_beam_receive(stream->output, stream->out_buffer,
603 - stream->max_mem - *plen);
604 + rv = h2_beam_receive(stream->output, stream->out_buffer,
605 + APR_NONBLOCK_READ, stream->max_mem - *plen);
606 H2_STREAM_OUT_LOG(APLOG_TRACE2, stream, "post");
611 + if (rv == APR_SUCCESS) {
612 + /* count the buffer again, now that we have read output */
613 + status = add_buffered_data(stream, requested, plen, peos, &complete, pheaders);
616 - if (APR_STATUS_IS_EOF(status)) {
617 + else if (APR_STATUS_IS_EOF(rv)) {
618 apr_bucket *eos = apr_bucket_eos_create(c->bucket_alloc);
619 APR_BRIGADE_INSERT_TAIL(stream->out_buffer, eos);
621 - status = APR_SUCCESS;
623 - else if (status == APR_SUCCESS) {
624 - /* do it again, now that we have gotten more */
625 - status = add_data(stream, requested, plen, peos, &complete, pheaders);
626 + else if (APR_STATUS_IS_EAGAIN(rv)) {
627 + /* we set this is the status of this call only if there
628 + * is no buffered data, see check below */
631 + /* real error reading. Give this back directly, even though
632 + * we may have something buffered. */
637 if (status == APR_SUCCESS) {
638 Index: modules/http2/h2_task.c
639 ===================================================================
640 --- modules/http2/h2_task.c (revision 1804645)
641 +++ modules/http2/h2_task.c (working copy)
643 apr_bucket_brigade* bb)
646 - apr_status_t status = APR_SUCCESS;
647 + apr_status_t rv = APR_SUCCESS;
648 int flush = 0, blocking;
651 @@ -148,17 +148,16 @@
656 /* we send block once we opened the output, so someone is there
657 * reading it *and* the task is not assigned to a h2_req_engine */
658 blocking = (!task->assigned && task->output.opened);
659 - if (!task->output.opened) {
660 - for (b = APR_BRIGADE_FIRST(bb);
661 - b != APR_BRIGADE_SENTINEL(bb);
662 - b = APR_BUCKET_NEXT(b)) {
663 - if (APR_BUCKET_IS_FLUSH(b)) {
667 + for (b = APR_BRIGADE_FIRST(bb);
668 + b != APR_BRIGADE_SENTINEL(bb);
669 + b = APR_BUCKET_NEXT(b)) {
670 + if (APR_BUCKET_IS_FLUSH(b) || APR_BUCKET_IS_EOS(b) || AP_BUCKET_IS_EOR(b)) {
676 @@ -166,32 +165,48 @@
677 /* still have data buffered from previous attempt.
678 * setaside and append new data and try to pass the complete data */
679 if (!APR_BRIGADE_EMPTY(bb)) {
680 - status = ap_save_brigade(f, &task->output.bb, &bb, task->pool);
681 + if (APR_SUCCESS != (rv = ap_save_brigade(f, &task->output.bb, &bb, task->pool))) {
685 - if (status == APR_SUCCESS) {
686 - status = send_out(task, task->output.bb, blocking);
688 + rv = send_out(task, task->output.bb, blocking);
691 - /* no data buffered here, try to pass the brigade directly */
692 - status = send_out(task, bb, blocking);
693 - if (status == APR_SUCCESS && !APR_BRIGADE_EMPTY(bb)) {
694 - /* could not write all, buffer the rest */
695 - ap_log_cerror(APLOG_MARK, APLOG_DEBUG, status, task->c, APLOGNO(03405)
696 - "h2_slave_out(%s): saving brigade",
698 - status = ap_save_brigade(f, &task->output.bb, &bb, task->pool);
700 + /* no data buffered previously, pass brigade directly */
701 + rv = send_out(task, bb, blocking);
703 + if (APR_SUCCESS == rv && !APR_BRIGADE_EMPTY(bb)) {
704 + /* output refused to buffer it all, time to open? */
705 + if (!task->output.opened && APR_SUCCESS == (rv = open_output(task))) {
706 + /* Make another attempt to send the data. With the output open,
707 + * the call might be blocking and send all data, so we do not need
708 + * to save the brigade */
711 + else if (blocking && flush) {
712 + /* Need to keep on doing this. */
716 + if (APR_SUCCESS == rv) {
717 + /* could not write all, buffer the rest */
718 + ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, task->c, APLOGNO(03405)
719 + "h2_slave_out(%s): saving brigade", task->id);
721 + rv = ap_save_brigade(f, &task->output.bb, &bb, task->pool);
727 - if (status == APR_SUCCESS && !task->output.opened && flush) {
728 + if (APR_SUCCESS == rv && !task->output.opened && flush) {
729 /* got a flush or could not write all, time to tell someone to read */
730 - status = open_output(task);
731 + rv = open_output(task);
733 - ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, task->c,
735 + ap_log_cerror(APLOG_MARK, APLOG_TRACE2, rv, task->c,
736 "h2_slave_out(%s): slave_out leave", task->id);
741 static apr_status_t output_finish(h2_task *task)
742 Index: modules/http2/h2_version.h
743 ===================================================================
744 --- modules/http2/h2_version.h (revision 1804645)
745 +++ modules/http2/h2_version.h (working copy)
748 * Version number of the http2 module as c string
750 -#define MOD_HTTP2_VERSION "1.10.7"
751 +#define MOD_HTTP2_VERSION "1.10.10"
756 * release. This is a 24 bit number with 8 bits for major number, 8 bits
757 * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
759 -#define MOD_HTTP2_VERSION_NUM 0x010a06
760 +#define MOD_HTTP2_VERSION_NUM 0x010a0a
763 #endif /* mod_h2_h2_version_h */
765 ===================================================================
766 --- modules/http2 (revision 1804645)
767 +++ modules/http2 (working copy)
769 Property changes on: modules/http2
770 ___________________________________________________________________
771 Modified: svn:mergeinfo
773 Merged /httpd/httpd/trunk/modules/http2:r1803420,1803454,1804090
775 ===================================================================
776 --- . (revision 1804645)
779 Property changes on: .
780 ___________________________________________________________________
781 Modified: svn:mergeinfo
783 Merged /httpd/httpd/trunk:r1803420,1803454,1804090