[arch-commits] Commit in mod_fcgid/repos (4 files)

Felix Yan felixonmars at archlinux.org
Fri Nov 9 22:10:34 UTC 2018


    Date: Friday, November 9, 2018 @ 22:10:33
  Author: felixonmars
Revision: 338653

archrelease: copy trunk to staging-x86_64

Added:
  mod_fcgid/repos/staging-x86_64/
  mod_fcgid/repos/staging-x86_64/30_fix-bts-691929.patch
    (from rev 338652, mod_fcgid/trunk/30_fix-bts-691929.patch)
  mod_fcgid/repos/staging-x86_64/PKGBUILD
    (from rev 338652, mod_fcgid/trunk/PKGBUILD)
  mod_fcgid/repos/staging-x86_64/large-file-upload.patch
    (from rev 338652, mod_fcgid/trunk/large-file-upload.patch)

-------------------------+
 30_fix-bts-691929.patch |   67 +++++++++++++++++++++++++++
 PKGBUILD                |   37 +++++++++++++++
 large-file-upload.patch |  112 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 216 insertions(+)

Copied: mod_fcgid/repos/staging-x86_64/30_fix-bts-691929.patch (from rev 338652, mod_fcgid/trunk/30_fix-bts-691929.patch)
===================================================================
--- staging-x86_64/30_fix-bts-691929.patch	                        (rev 0)
+++ staging-x86_64/30_fix-bts-691929.patch	2018-11-09 22:10:33 UTC (rev 338653)
@@ -0,0 +1,67 @@
+Description: Patch to set CONTENT_LENGTH FCGI params based on actual request body
+Author: Dominic Benson
+Bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=53332
+
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' libapache2-mod-fcgid-2.3.6~/modules/fcgid/fcgid_spawn_ctl.c libapache2-mod-fcgid-2.3.6/modules/fcgid/fcgid_spawn_ctl.c
+--- mod_fcgid-2.3.6.orig/modules/fcgid/fcgid_bridge.c	2012-05-30 09:53:20.928783540 +0100
++++ mod_fcgid-2.3.6/modules/fcgid/fcgid_bridge.c	2012-05-30 18:04:01.648850877 +0100
+@@ -662,6 +662,11 @@ static int add_request_body(request_rec
+     apr_brigade_destroy(input_brigade);
+     apr_brigade_destroy(tmp_brigade);
+ 
++    char sizestr[21];
++    apr_snprintf(sizestr, sizeof sizestr, "%" APR_OFF_T_FMT, request_size);
++    apr_table_set(r->subprocess_env, "CONTENT_LENGTH", sizestr);
++    apr_table_unset(r->subprocess_env, "HTTP_TRANSFER_ENCODING");
++
+     /* Append an empty body stdin header */
+     stdin_request_header = apr_bucket_alloc(sizeof(FCGI_Header),
+                                             r->connection->bucket_alloc);
+@@ -682,31 +687,37 @@ static int add_request_body(request_rec
+ int bridge_request(request_rec * r, int role, fcgid_cmd_conf *cmd_conf)
+ {
+     apr_bucket_brigade *output_brigade;
++    apr_bucket_brigade *header_brigade;
+     apr_bucket *bucket_eos;
+-    char **envp = ap_create_environment(r->pool,
+-                                        r->subprocess_env);
+     int rc;
+ 
+     /* Create brigade for the request to fastcgi server */
+     output_brigade =
+         apr_brigade_create(r->pool, r->connection->bucket_alloc);
++    header_brigade =
++        apr_brigade_create(r->pool, r->connection->bucket_alloc);
++
++    if (role == FCGI_RESPONDER) {
++        rc = add_request_body(r, r->pool, output_brigade);
++        if (rc) {
++            return rc;
++        }
++    }
++
++    char **envp = ap_create_environment(r->pool,
++                                        r->subprocess_env);
+ 
+     /* Build the begin request and environ request, append them to output_brigade */
+     if (!build_begin_block
+-        (role, r, r->connection->bucket_alloc, output_brigade)
++        (role, r, r->connection->bucket_alloc, header_brigade)
+         || !build_env_block(r, envp, r->connection->bucket_alloc,
+-                            output_brigade)) {
++                            header_brigade)) {
+         ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
+                       "mod_fcgid: can't build begin or env request");
+         return HTTP_INTERNAL_SERVER_ERROR;
+     }
+ 
+-    if (role == FCGI_RESPONDER) {
+-        rc = add_request_body(r, r->pool, output_brigade);
+-        if (rc) {
+-            return rc;
+-        }
+-    }
++    APR_BRIGADE_PREPEND(output_brigade,header_brigade);
+ 
+     /* The eos bucket now */
+     bucket_eos = apr_bucket_eos_create(r->connection->bucket_alloc);

Copied: mod_fcgid/repos/staging-x86_64/PKGBUILD (from rev 338652, mod_fcgid/trunk/PKGBUILD)
===================================================================
--- staging-x86_64/PKGBUILD	                        (rev 0)
+++ staging-x86_64/PKGBUILD	2018-11-09 22:10:33 UTC (rev 338653)
@@ -0,0 +1,37 @@
+# Maintainer: Jan de Groot <jgc at archlinux.org>
+
+pkgname=mod_fcgid
+pkgver=2.3.9
+pkgrel=4
+pkgdesc="A FastCGI module for Apache HTTP Server."
+license=('APACHE')
+arch=('x86_64')
+url="https://httpd.apache.org/mod_fcgid/"
+depends=('apache')
+source=(https://www.apache.org/dist/httpd/mod_fcgid/mod_fcgid-$pkgver.tar.bz2{,.asc}
+30_fix-bts-691929.patch
+large-file-upload.patch)
+sha1sums=('f0b6d87dfcfe18b318905a3f91274051f3f17945'
+          'SKIP'
+          '661a16c15ba413cc841ef6ae0534a12eaee1b703'
+          'b281882ff13028a4c3d0c2189263eea12e1189df')
+validpgpkeys=('5B5181C2C0AB13E59DA3F7A3EC582EB639FF092C') # Jeff Trawick (CODE SIGNING KEY) <trawick at apache.org>
+
+prepare() {
+  cd $pkgname-$pkgver
+  patch -Np1 -i ../30_fix-bts-691929.patch
+  patch -Np0 -i ../large-file-upload.patch
+}
+
+build() {
+  cd $pkgname-$pkgver
+  ./configure.apxs 
+  make
+}
+
+package() {
+  cd $pkgname-$pkgver
+  make DESTDIR="$pkgdir" install
+  rm -rf "${pkgdir}/usr/share"
+  rm -rf "${pkgdir}/etc"
+}

Copied: mod_fcgid/repos/staging-x86_64/large-file-upload.patch (from rev 338652, mod_fcgid/trunk/large-file-upload.patch)
===================================================================
--- staging-x86_64/large-file-upload.patch	                        (rev 0)
+++ staging-x86_64/large-file-upload.patch	2018-11-09 22:10:33 UTC (rev 338653)
@@ -0,0 +1,112 @@
+--- modules/fcgid/fcgid_proc_win.c	2015-08-28 13:39:44.583673500 +0200
++++ modules/fcgid/fcgid_proc_win.c	2015-08-28 13:40:05.588100000 +0200
+@@ -380,19 +380,22 @@ 
+     apr_bucket *bucket_request;
+     apr_status_t rv;
+     DWORD transferred;
++    apr_bucket_brigade* tmpbb = apr_brigade_create(birgade_send->p, 
++                                                   birgade_send->bucket_alloc);
+ 
+     handle_info = (fcgid_namedpipe_handle *) ipc_handle->ipc_handle_info;
+ 
+-    for (bucket_request = APR_BRIGADE_FIRST(birgade_send);
+-         bucket_request != APR_BRIGADE_SENTINEL(birgade_send);
+-         bucket_request = APR_BUCKET_NEXT(bucket_request))
+-    {
++    while (!APR_BRIGADE_EMPTY(birgade_send)) {
+         const char *write_buf;
+         apr_size_t write_buf_len;
+         apr_size_t has_write;
+ 
+-        if (APR_BUCKET_IS_METADATA(bucket_request))
++        bucket_request = APR_BRIGADE_FIRST(birgade_send);
++
++        if (APR_BUCKET_IS_METADATA(bucket_request)) {
++            apr_bucket_delete(bucket_request);
+             continue;
++        }
+ 
+         if ((rv = apr_bucket_read(bucket_request, &write_buf, &write_buf_len,
+                                   APR_BLOCK_READ)) != APR_SUCCESS) {
+@@ -401,6 +404,9 @@ 
+             return rv;
+         }
+ 
++        APR_BUCKET_REMOVE(bucket_request);
++        APR_BRIGADE_INSERT_TAIL(tmpbb, bucket_request);
++
+         /* Write the buffer to fastcgi server */
+         has_write = 0;
+         while (has_write < write_buf_len) {
+@@ -411,6 +417,7 @@ 
+                           write_buf_len - has_write,
+                           &byteswrite, &handle_info->overlap_write)) {
+                 has_write += byteswrite;
++                apr_brigade_cleanup(tmpbb);
+                 continue;
+             } else if ((rv = GetLastError()) != ERROR_IO_PENDING) {
+                 ap_log_rerror(APLOG_MARK, APLOG_WARNING,
+@@ -437,6 +444,7 @@ 
+                         return APR_ESPIPE;
+                     }
+                     has_write += transferred;
++                    apr_brigade_cleanup(tmpbb);
+                     continue;
+                 } else {
+                     ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0,
+@@ -448,6 +456,7 @@ 
+         }
+     }
+ 
++    apr_brigade_destroy(tmpbb);
+     return APR_SUCCESS;
+ }
+ 
+--- modules/fcgid/fcgid_proc_unix.c	2015-08-28 13:39:44.614914500 +0200
++++ modules/fcgid/fcgid_proc_unix.c	2015-08-28 13:39:44.724299600 +0200
+@@ -762,14 +762,16 @@ 
+     struct iovec vec[FCGID_VEC_COUNT];
+     int nvec = 0;
+     apr_bucket *e;
++    apr_bucket_brigade* tmpbb = apr_brigade_create(output_brigade->p,output_brigade->bucket_alloc);
++
++    while (!APR_BRIGADE_EMPTY(output_brigade)) {
++        e = APR_BRIGADE_FIRST(output_brigade);
+ 
+-    for (e = APR_BRIGADE_FIRST(output_brigade);
+-         e != APR_BRIGADE_SENTINEL(output_brigade);
+-         e = APR_BUCKET_NEXT(e)) {
+         apr_size_t len;
+         const char* base;
+ 
+         if (APR_BUCKET_IS_METADATA(e)) {
++            apr_bucket_delete(e);
+             continue;
+         }
+ 
+@@ -780,6 +782,9 @@ 
+             return rv;
+         }
+ 
++        APR_BUCKET_REMOVE(e);
++        APR_BRIGADE_INSERT_TAIL(tmpbb, e);
++
+         vec[nvec].iov_len = len;
+         vec[nvec].iov_base = (char*) base;
+         if (nvec == (FCGID_VEC_COUNT - 1)) {
+@@ -789,6 +794,7 @@ 
+                                FCGID_VEC_COUNT)) != APR_SUCCESS)
+                 return rv;
+             nvec = 0;
++            apr_brigade_cleanup(tmpbb);
+         }
+         else
+             nvec++;
+@@ -800,6 +806,7 @@ 
+             return rv;
+     }
+ 
++    apr_brigade_destroy(tmpbb);
+     return APR_SUCCESS;
+ }
+ 



More information about the arch-commits mailing list