archrelease: copy trunk to extra-x86_64
[arch-packages.git] / mod_fcgid / trunk / large-file-upload.patch
blob55f5ddcf274d77119bf6b308adc30301c09da10c
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
3 @@ -380,19 +380,22 @@
4 apr_bucket *bucket_request;
5 apr_status_t rv;
6 DWORD transferred;
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))
15 - {
16 + while (!APR_BRIGADE_EMPTY(birgade_send)) {
17 const char *write_buf;
18 apr_size_t write_buf_len;
19 apr_size_t has_write;
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);
26 continue;
27 + }
29 if ((rv = apr_bucket_read(bucket_request, &write_buf, &write_buf_len,
30 APR_BLOCK_READ)) != APR_SUCCESS) {
31 @@ -401,6 +404,9 @@
32 return rv;
35 + APR_BUCKET_REMOVE(bucket_request);
36 + APR_BRIGADE_INSERT_TAIL(tmpbb, bucket_request);
38 /* Write the buffer to fastcgi server */
39 has_write = 0;
40 while (has_write < write_buf_len) {
41 @@ -411,6 +417,7 @@
42 write_buf_len - has_write,
43 &byteswrite, &handle_info->overlap_write)) {
44 has_write += byteswrite;
45 + apr_brigade_cleanup(tmpbb);
46 continue;
47 } else if ((rv = GetLastError()) != ERROR_IO_PENDING) {
48 ap_log_rerror(APLOG_MARK, APLOG_WARNING,
49 @@ -437,6 +444,7 @@
50 return APR_ESPIPE;
52 has_write += transferred;
53 + apr_brigade_cleanup(tmpbb);
54 continue;
55 } else {
56 ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0,
57 @@ -448,6 +456,7 @@
61 + apr_brigade_destroy(tmpbb);
62 return APR_SUCCESS;
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
67 @@ -762,14 +762,16 @@
68 struct iovec vec[FCGID_VEC_COUNT];
69 int nvec = 0;
70 apr_bucket *e;
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)) {
79 apr_size_t len;
80 const char* base;
82 if (APR_BUCKET_IS_METADATA(e)) {
83 + apr_bucket_delete(e);
84 continue;
87 @@ -780,6 +782,9 @@
88 return rv;
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)) {
97 @@ -789,6 +794,7 @@
98 FCGID_VEC_COUNT)) != APR_SUCCESS)
99 return rv;
100 nvec = 0;
101 + apr_brigade_cleanup(tmpbb);
103 else
104 nvec++;
105 @@ -800,6 +806,7 @@
106 return rv;
109 + apr_brigade_destroy(tmpbb);
110 return APR_SUCCESS;