1 --- modules/fcgid/fcgid_proc_win.c 2015-08-28 13:39:44.583673500 +0200
2 +++ modules/fcgid/fcgid_proc_win.c 2015-08-28 13:40:05.588100000 +0200
4 apr_bucket *bucket_request;
7 + apr_bucket_brigade* tmpbb = apr_brigade_create(birgade_send->p,
8 + birgade_send->bucket_alloc);
10 handle_info = (fcgid_namedpipe_handle *) ipc_handle->ipc_handle_info;
12 - for (bucket_request = APR_BRIGADE_FIRST(birgade_send);
13 - bucket_request != APR_BRIGADE_SENTINEL(birgade_send);
14 - bucket_request = APR_BUCKET_NEXT(bucket_request))
16 + while (!APR_BRIGADE_EMPTY(birgade_send)) {
17 const char *write_buf;
18 apr_size_t write_buf_len;
21 - if (APR_BUCKET_IS_METADATA(bucket_request))
22 + bucket_request = APR_BRIGADE_FIRST(birgade_send);
24 + if (APR_BUCKET_IS_METADATA(bucket_request)) {
25 + apr_bucket_delete(bucket_request);
29 if ((rv = apr_bucket_read(bucket_request, &write_buf, &write_buf_len,
30 APR_BLOCK_READ)) != APR_SUCCESS) {
35 + APR_BUCKET_REMOVE(bucket_request);
36 + APR_BRIGADE_INSERT_TAIL(tmpbb, bucket_request);
38 /* Write the buffer to fastcgi server */
40 while (has_write < write_buf_len) {
42 write_buf_len - has_write,
43 &byteswrite, &handle_info->overlap_write)) {
44 has_write += byteswrite;
45 + apr_brigade_cleanup(tmpbb);
47 } else if ((rv = GetLastError()) != ERROR_IO_PENDING) {
48 ap_log_rerror(APLOG_MARK, APLOG_WARNING,
52 has_write += transferred;
53 + apr_brigade_cleanup(tmpbb);
56 ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0,
61 + apr_brigade_destroy(tmpbb);
65 --- modules/fcgid/fcgid_proc_unix.c 2015-08-28 13:39:44.614914500 +0200
66 +++ modules/fcgid/fcgid_proc_unix.c 2015-08-28 13:39:44.724299600 +0200
68 struct iovec vec[FCGID_VEC_COUNT];
71 + apr_bucket_brigade* tmpbb = apr_brigade_create(output_brigade->p,output_brigade->bucket_alloc);
73 + while (!APR_BRIGADE_EMPTY(output_brigade)) {
74 + e = APR_BRIGADE_FIRST(output_brigade);
76 - for (e = APR_BRIGADE_FIRST(output_brigade);
77 - e != APR_BRIGADE_SENTINEL(output_brigade);
78 - e = APR_BUCKET_NEXT(e)) {
82 if (APR_BUCKET_IS_METADATA(e)) {
83 + apr_bucket_delete(e);
91 + APR_BUCKET_REMOVE(e);
92 + APR_BRIGADE_INSERT_TAIL(tmpbb, e);
94 vec[nvec].iov_len = len;
95 vec[nvec].iov_base = (char*) base;
96 if (nvec == (FCGID_VEC_COUNT - 1)) {
98 FCGID_VEC_COUNT)) != APR_SUCCESS)
101 + apr_brigade_cleanup(tmpbb);
109 + apr_brigade_destroy(tmpbb);