Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package uwsgi for openSUSE:Factory checked in at 2023-10-19 22:47:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/uwsgi (Old) and /work/SRC/openSUSE:Factory/.uwsgi.new.1945 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "uwsgi" Thu Oct 19 22:47:20 2023 rev:51 rq:1118573 version:2.0.22 Changes: -------- --- /work/SRC/openSUSE:Factory/uwsgi/uwsgi.changes 2023-07-05 15:30:56.778703797 +0200 +++ /work/SRC/openSUSE:Factory/.uwsgi.new.1945/uwsgi.changes 2023-10-19 22:49:44.203692417 +0200 @@ -1,0 +2,11 @@ +Wed Oct 18 09:48:50 UTC 2023 - Dominique Leuenberger <[email protected]> + +- Update to version 2.0.22: + + apache2/mod_proxy_uwsgi: stricter backend HTTP response + parsing/validation (CVE-2023-27522). + + plugins/rack: fix compilation with ruby 3.1. + + plugins/php: fix build with PHP >= 8.2. +- Drop uwsgi-php82-php_module_startup-signature.patch: fixed + upstream. + +------------------------------------------------------------------- Old: ---- 2.0.21.tar.gz uwsgi-php82-php_module_startup-signature.patch New: ---- 2.0.22.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ uwsgi.spec ++++++ --- /var/tmp/diff_new_pack.dDzbfd/_old 2023-10-19 22:49:44.955719692 +0200 +++ /var/tmp/diff_new_pack.dDzbfd/_new 2023-10-19 22:49:44.955719692 +0200 @@ -29,7 +29,7 @@ %endif Name: uwsgi -Version: 2.0.21 +Version: 2.0.22 Release: 0 Summary: Application Container Server for Networked/Clustered Web Applications License: Apache-2.0 AND GPL-2.0-only WITH GCC-exception-2.0 @@ -57,8 +57,6 @@ Patch4: uwsgi-2.0.18-postgresql-config.patch # PATCH-FIX-UPSTREAM uwsgi-ld-noexecstack.patch - Do not create executable stack Patch5: uwsgi-ld-noexecstack.patch -# https://github.com/unbit/uwsgi/commit/509a0fdd12870d0bf5b4c1ef7d1f7f -Patch6: uwsgi-php82-php_module_startup-signature.patch BuildRequires: apache-rpm-macros %if 0%{suse_version} < 1500 BuildRequires: apache2-devel @@ -449,7 +447,6 @@ %patch3 -p1 %patch4 -p1 %patch5 -p1 -%patch6 -p1 # Generate a config that builds all plugins except for examples and stuff we # can't satisfy the requirements for or are just broken excluded_plugins="" ++++++ 2.0.21.tar.gz -> 2.0.22.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/.github/workflows/compile-test.yml new/uwsgi-2.0.22/.github/workflows/compile-test.yml --- old/uwsgi-2.0.21/.github/workflows/compile-test.yml 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/.github/workflows/compile-test.yml 2023-07-27 17:34:12.000000000 +0200 @@ -9,16 +9,21 @@ jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: + - name: remove sury php ppa that does not ship libphpX.Y-embed + run: | + sudo add-apt-repository --remove ppa:ondrej/php + sudo apt remove php7.4-dev php7.4 php7.4-common - name: Install dependencies run: | sudo apt update -qq - sudo apt install --no-install-recommends -qqyf python3.6-dev \ + sudo apt install --no-install-recommends -qqyf python3.8-dev \ libxml2-dev libpcre3-dev libcap2-dev \ - php7.2-dev libphp7.2-embed libargon2-0-dev libsodium-dev \ - liblua5.1-0-dev ruby2.5-dev \ + libargon2-0-dev libsodium-dev \ + php7.4-dev libphp7.4-embed \ + liblua5.1-0-dev ruby2.7-dev \ libjansson-dev libldap2-dev libpq-dev \ libpam0g-dev libsqlite3-dev libyaml-dev \ libzmq3-dev libmatheval-dev libperl-dev \ @@ -27,12 +32,12 @@ libboost-thread-dev libboost-filesystem-dev \ libssl-dev libacl1-dev python-greenlet-dev \ libcurl4-openssl-dev \ - openjdk-8-jdk libgloox-dev gccgo \ + openjdk-11-jdk libgloox-dev gccgo \ cli-common-dev mono-devel mono-mcs uuid-dev \ curl check - uses: actions/checkout@v2 - name: Build kitchensink uWSGI binary - run: UWSGICONFIG_PHPPATH=php-config7.2 /usr/bin/python3 uwsgiconfig.py --build travis + run: UWSGICONFIG_PHPPATH=php-config7.4 /usr/bin/python3 uwsgiconfig.py --build travis - name: Build uWSGI binary run: | /usr/bin/python3 uwsgiconfig.py --build base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/.github/workflows/test.yml new/uwsgi-2.0.22/.github/workflows/test.yml --- old/uwsgi-2.0.21/.github/workflows/test.yml 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/.github/workflows/test.yml 2023-07-27 17:34:12.000000000 +0200 @@ -9,16 +9,14 @@ jobs: python: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] test-suite: [unittest, python, deadlocks] steps: - name: Add deadnakes ppa - run: | - sudo apt install -qqyf software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa -y + run: sudo add-apt-repository ppa:deadsnakes/ppa -y - name: Install dependencies run: | sudo apt update -qq @@ -26,7 +24,7 @@ libpcre3-dev libjansson-dev libcap2-dev \ curl check - name: Install distutils - if: contains(fromJson('["3.8","3.9","3.10","3.11"]'), matrix.python-version) + if: contains(fromJson('["3.6","3.7","3.8","3.9","3.10","3.11"]'), matrix.python-version) run: | sudo apt install --no-install-recommends -qqyf python${{ matrix.python-version }}-distutils \ - uses: actions/checkout@v2 @@ -52,20 +50,16 @@ rack: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: - rack-version: ["251"] + rack-version: ["270"] steps: - - name: Add deadnakes ppa - run: | - sudo apt install -qqyf software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa -y - name: Install dependencies run: | sudo apt update -qq sudo apt install --no-install-recommends -qqyf python3-dev \ - libpcre3-dev libjansson-dev libcap2-dev \ + libpcre3-dev libjansson-dev libcap2-dev ruby2.7-dev \ curl check - uses: actions/checkout@v2 - name: Run unit tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/PKG-INFO new/uwsgi-2.0.22/PKG-INFO --- old/uwsgi-2.0.21/PKG-INFO 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/PKG-INFO 2023-07-27 17:34:12.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: uWSGI -Version: 2.0.21 +Version: 2.0.22 Summary: The uWSGI server Home-page: https://uwsgi-docs.readthedocs.io/en/latest/ Author: Unbit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/apache2/mod_proxy_uwsgi.c new/uwsgi-2.0.22/apache2/mod_proxy_uwsgi.c --- old/uwsgi-2.0.21/apache2/mod_proxy_uwsgi.c 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/apache2/mod_proxy_uwsgi.c 2023-07-27 17:34:12.000000000 +0200 @@ -315,18 +315,16 @@ apr_bucket_brigade *pass_bb = apr_brigade_create(r->pool, c->bucket_alloc); len = ap_getline(buffer, sizeof(buffer), rp, 1); - if (len <= 0) { - // oops + /* invalid or empty */ return HTTP_INTERNAL_SERVER_ERROR; } - backend->worker->s->read += len; - - if (len >= sizeof(buffer)-1) { - // oops + if ((apr_size_t)len >= sizeof(buffer)) { + /* too long */ return HTTP_INTERNAL_SERVER_ERROR; } + /* Position of http status code */ int status_start; if (apr_date_checkmask(buffer, "HTTP/#.# ###*")) { @@ -334,8 +332,8 @@ } else if (apr_date_checkmask(buffer, "HTTP/# ###*")) { status_start = 7; } else { - // oops - return HTTP_INTERNAL_SERVER_ERROR; + /* not HTTP */ + return HTTP_BAD_GATEWAY; } int status_end = status_start + 3; @@ -354,17 +352,41 @@ } r->status_line = apr_pstrdup(r->pool, &buffer[status_start]); - // start parsing headers; + /* parse headers */ while ((len = ap_getline(buffer, sizeof(buffer), rp, 1)) > 0) { + if ((apr_size_t)len >= sizeof(buffer)) { + /* too long */ + len = -1; + break; + } value = strchr(buffer, ':'); - // invalid header skip - if (!value) continue; - *value = '\0'; - ++value; + if (!value) { + /* invalid header */ + len = -1; + break; + } + *value++ = '\0'; + if (*ap_scan_http_token(buffer)) { + /* invalid name */ + len = -1; + break; + } while (apr_isspace(*value)) ++value; for (end = &value[strlen(value)-1]; end > value && apr_isspace(*end); --end) *end = '\0'; + if (*ap_scan_http_field_content(value)) { + /* invalid value */ + len = -1; + break; + } apr_table_add(r->headers_out, buffer, value); } + if (len < 0) { + /* Reset headers, but not to NULL because things below the chain expect + * this to be non NULL e.g. the ap_content_length_filter. + */ + r->headers_out = apr_table_make(r->pool, 1); + return HTTP_BAD_GATEWAY; + } if ((buf = apr_table_get(r->headers_out, "Content-Type"))) { ap_set_content_type(r, apr_pstrdup(r->pool, buf)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/buildconf/travis.ini new/uwsgi-2.0.22/buildconf/travis.ini --- old/uwsgi-2.0.21/buildconf/travis.ini 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/buildconf/travis.ini 2023-07-27 17:34:12.000000000 +0200 @@ -1,3 +1,3 @@ [uwsgi] -main_plugin = psgi,rack,lua,python,gevent,php,cgi,pty,xslt,msgpack,geoip,v8,pam,ldap,mono,jvm,ring,jwsgi,servlet,pypy,airbrake,alarm_curl,alarm_xmpp,asyncio,cheaper_backlog2,clock_monotonic,clock_realtime,cplusplus,curl_cron,dumbloop,dummy,echo,emperor_amqp,emperor_pg,emperor_zeromq,example,exception_log,fiber,forkptyrouter,graylog2,legion_cache_fetch,libffi,logcrypto,logpipe,logzmq,matheval,notfound,rbthreads,router_access,router_radius,router_spnego,router_xmldir,sqlite3,ssi,stats_pusher_file,stats_pusher_statsd,tornado,transformation_toupper,tuntap,webdav,xattr,zabbix +main_plugin = psgi,rack,lua,python,gevent,php,cgi,pty,xslt,msgpack,geoip,pam,ldap,mono,jvm,ring,jwsgi,servlet,pypy,airbrake,alarm_curl,asyncio,cheaper_backlog2,clock_monotonic,clock_realtime,cplusplus,curl_cron,dumbloop,dummy,echo,emperor_amqp,emperor_pg,emperor_zeromq,example,exception_log,fiber,forkptyrouter,graylog2,legion_cache_fetch,libffi,logcrypto,logpipe,logzmq,matheval,notfound,rbthreads,router_access,router_radius,router_spnego,router_xmldir,sqlite3,ssi,stats_pusher_file,stats_pusher_statsd,tornado,transformation_toupper,tuntap,webdav,xattr,zabbix inherit = base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/core/init.c new/uwsgi-2.0.22/core/init.c --- old/uwsgi-2.0.21/core/init.c 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/core/init.c 2023-07-27 17:34:12.000000000 +0200 @@ -197,6 +197,8 @@ uwsgi_master_fifo_prepare(); uwsgi.notify_socket_fd = -1; + + uwsgi.harakiri_graceful_signal = SIGTERM; } void uwsgi_setup_reload() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/core/master_checks.c new/uwsgi-2.0.22/core/master_checks.c --- old/uwsgi-2.0.21/core/master_checks.c 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/core/master_checks.c 2023-07-27 17:34:12.000000000 +0200 @@ -180,22 +180,57 @@ } +int uwsgi_master_check_harakiri(int w, int c, int harakiri) { +/** + * Triggers a harakiri when the following conditions are met: + * - harakiri timeout > current time + * - listen queue pressure (ie backlog > harakiri_queue_threshold) + * + * The first harakiri attempt on a worker will be graceful if harakiri_graceful_timeout > 0, + * then the worker has harakiri_graceful_timeout seconds to shutdown cleanly, otherwise + * a second harakiri will trigger a SIGKILL + * + */ +#ifdef __linux__ + int backlog = uwsgi.shared->backlog; +#else + int backlog = 0; +#endif + if (harakiri == 0 || harakiri > (time_t) uwsgi.current_time) { + return 0; + } + // no pending harakiri for the worker and no backlog pressure, safe to skip + if (uwsgi.workers[w].pending_harakiri == 0 && backlog < uwsgi.harakiri_queue_threshold) { + uwsgi_log_verbose("HARAKIRI: Skipping harakiri on worker %d. Listen queue is smaller than the threshold (%d < %d)\n", + w, backlog, uwsgi.harakiri_queue_threshold); + return 0; + } + + trigger_harakiri(w); + if (uwsgi.harakiri_graceful_timeout > 0) { + uwsgi.workers[w].harakiri = harakiri + uwsgi.harakiri_graceful_timeout; + uwsgi_log_verbose("HARAKIRI: graceful termination attempt on worker %d with signal %d. Next harakiri: %d\n", + w, uwsgi.harakiri_graceful_signal, uwsgi.workers[w].harakiri); + } + return 1; +} + int uwsgi_master_check_workers_deadline() { - int i; + int i,j; int ret = 0; for (i = 1; i <= uwsgi.numproc; i++) { - /* first check for harakiri */ - if (uwsgi.workers[i].harakiri > 0) { - if (uwsgi.workers[i].harakiri < (time_t) uwsgi.current_time) { - trigger_harakiri(i); + for(j=0;j<uwsgi.cores;j++) { + /* first check for harakiri */ + if (uwsgi_master_check_harakiri(i, j, uwsgi.workers[i].harakiri)) { + uwsgi_log_verbose("HARAKIRI triggered by worker %d core %d !!!\n", i, j); ret = 1; + break; } - } - /* then user-defined harakiri */ - if (uwsgi.workers[i].user_harakiri > 0) { - if (uwsgi.workers[i].user_harakiri < (time_t) uwsgi.current_time) { - trigger_harakiri(i); + /* then user-defined harakiri */ + if (uwsgi_master_check_harakiri(i, j, uwsgi.workers[i].user_harakiri)) { + uwsgi_log_verbose("HARAKIRI (user) triggered by worker %d core %d !!!\n", i, j); ret = 1; + break; } } // then for evil memory checkers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/core/master_utils.c new/uwsgi-2.0.22/core/master_utils.c --- old/uwsgi-2.0.21/core/master_utils.c 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/core/master_utils.c 2023-07-27 17:34:12.000000000 +0200 @@ -1561,7 +1561,10 @@ void trigger_harakiri(int i) { int j; - uwsgi_log_verbose("*** HARAKIRI ON WORKER %d (pid: %d, try: %d) ***\n", i, uwsgi.workers[i].pid, uwsgi.workers[i].pending_harakiri + 1); + uwsgi_log_verbose("*** HARAKIRI ON WORKER %d (pid: %d, try: %d, graceful: %s) ***\n", i, + uwsgi.workers[i].pid, + uwsgi.workers[i].pending_harakiri + 1, + uwsgi.workers[i].pending_harakiri > 0 ? "no": "yes"); if (uwsgi.harakiri_verbose) { #ifdef __linux__ int proc_file; @@ -1610,7 +1613,11 @@ } uwsgi_dump_worker(i, "HARAKIRI"); - kill(uwsgi.workers[i].pid, SIGKILL); + if (uwsgi.workers[i].pending_harakiri == 0 && uwsgi.harakiri_graceful_timeout > 0) { + kill(uwsgi.workers[i].pid, uwsgi.harakiri_graceful_signal); + } else { + kill(uwsgi.workers[i].pid, SIGKILL); + } if (!uwsgi.workers[i].pending_harakiri) uwsgi.workers[i].harakiri_count++; uwsgi.workers[i].pending_harakiri++; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/core/offload.c new/uwsgi-2.0.22/core/offload.c --- old/uwsgi-2.0.21/core/offload.c 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/core/offload.c 2023-07-27 17:34:12.000000000 +0200 @@ -236,11 +236,11 @@ close(uor->pipe[0]); } - free(uor); - #ifdef UWSGI_DEBUG uwsgi_log("[offload] destroyed session %p\n", uor); #endif + + free(uor); } static void uwsgi_offload_append(struct uwsgi_thread *ut, struct uwsgi_offload_request *uor) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/core/uwsgi.c new/uwsgi-2.0.22/core/uwsgi.c --- old/uwsgi-2.0.21/core/uwsgi.c 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/core/uwsgi.c 2023-07-27 17:34:12.000000000 +0200 @@ -81,6 +81,9 @@ {"thunder-lock", no_argument, 0, "serialize accept() usage (if possible)", uwsgi_opt_true, &uwsgi.use_thunder_lock, 0}, {"harakiri", required_argument, 't', "set harakiri timeout", uwsgi_opt_set_int, &uwsgi.harakiri_options.workers, 0}, {"harakiri-verbose", no_argument, 0, "enable verbose mode for harakiri", uwsgi_opt_true, &uwsgi.harakiri_verbose, 0}, + {"harakiri-graceful-timeout", required_argument, 0, "interval between graceful harakiri attempt and a sigkill", uwsgi_opt_set_int, &uwsgi.harakiri_graceful_timeout, 0}, + {"harakiri-graceful-signal", required_argument, 0, "use this signal instead of sigterm for graceful harakiri attempts", uwsgi_opt_set_int, &uwsgi.harakiri_graceful_signal, 0}, + {"harakiri-queue-threshold", required_argument, 0, "only trigger harakiri if queue is greater than this threshold", uwsgi_opt_set_int, &uwsgi.harakiri_queue_threshold, 0}, {"harakiri-no-arh", no_argument, 0, "do not enable harakiri during after-request-hook", uwsgi_opt_true, &uwsgi.harakiri_no_arh, 0}, {"no-harakiri-arh", no_argument, 0, "do not enable harakiri during after-request-hook", uwsgi_opt_true, &uwsgi.harakiri_no_arh, 0}, {"no-harakiri-after-req-hook", no_argument, 0, "do not enable harakiri during after-request-hook", uwsgi_opt_true, &uwsgi.harakiri_no_arh, 0}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/plugins/jvm/uwsgiplugin.py new/uwsgi-2.0.22/plugins/jvm/uwsgiplugin.py --- old/uwsgi-2.0.21/plugins/jvm/uwsgiplugin.py 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/plugins/jvm/uwsgiplugin.py 2023-07-27 17:34:12.000000000 +0200 @@ -32,17 +32,20 @@ JVM_INCPATH = ['-I"/cygdrive/c/Program Files/Java/jdk1.7.0_17/include"', '-I"/cygdrive/c/Program Files/Java/jdk1.7.0_17/include/win32"'] JVM_LIBPATH = ['-L"/cygdrive/c/Program Files/Java/jdk1.7.0_17/jre/bin/server"'] else: - known_jvms = ('/usr/lib/jvm/java-7-openjdk', '/usr/local/openjdk7', '/usr/lib/jvm/java-6-openjdk', '/usr/local/openjdk', '/usr/java', '/usr/lib/jvm/java/', '/usr/lib/jvm/java-8-openjdk-%s' % arch) + known_jvms = ('/usr/lib/jvm/java-7-openjdk', '/usr/local/openjdk7', '/usr/lib/jvm/java-6-openjdk', '/usr/local/openjdk', '/usr/java', '/usr/lib/jvm/java/', '/usr/lib/jvm/java-8-openjdk-%s' % arch, '/usr/lib/jvm/java-11-openjdk-%s' % arch) for jvm in known_jvms: - if os.path.exists(jvm + '/include'): - JVM_INCPATH = ["-I%s/include/" % jvm, "-I%s/include/%s" % (jvm, operating_system)] - JVM_LIBPATH = ["-L%s/jre/lib/%s/server" % (jvm, arch)] - break - if os.path.exists("%s-%s/include" % (jvm, arch)): - jvm = "%s-%s" % (jvm, arch) - JVM_INCPATH = ["-I%s/include/" % jvm, "-I%s/include/%s" % (jvm, operating_system)] - JVM_LIBPATH = ["-L%s/jre/lib/%s/server" % (jvm, arch)] - break + if os.path.exists(jvm + '/include'): + JVM_INCPATH = ["-I%s/include/" % jvm, "-I%s/include/%s" % (jvm, operating_system)] + if os.path.exists("%s/jre"): + JVM_LIBPATH = ["-L%s/jre/lib/%s/server" % (jvm, arch)] + else: + JVM_LIBPATH = ["-L%s/lib/server" % (jvm,)] + break + if os.path.exists("%s-%s/include" % (jvm, arch)): + jvm = "%s-%s" % (jvm, arch) + JVM_INCPATH = ["-I%s/include/" % jvm, "-I%s/include/%s" % (jvm, operating_system)] + JVM_LIBPATH = ["-L%s/jre/lib/%s/server" % (jvm, arch)] + break try: JVM_INCPATH = ['-I"' + os.environ['UWSGICONFIG_JVM_INCPATH'] + '"'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/plugins/php/php_plugin.c new/uwsgi-2.0.22/plugins/php/php_plugin.c --- old/uwsgi-2.0.21/plugins/php/php_plugin.c 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/plugins/php/php_plugin.c 2023-07-27 17:34:12.000000000 +0200 @@ -607,7 +607,11 @@ static int php_uwsgi_startup(sapi_module_struct *sapi_module) { +#if ((PHP_MAJOR_VERSION >= 8) && (PHP_MINOR_VERSION >= 2)) + if (php_module_startup(&uwsgi_sapi_module, &uwsgi_module_entry)==FAILURE) { +#else if (php_module_startup(&uwsgi_sapi_module, &uwsgi_module_entry, 1)==FAILURE) { +#endif return FAILURE; } else { return SUCCESS; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/plugins/python/python_plugin.c new/uwsgi-2.0.22/plugins/python/python_plugin.c --- old/uwsgi-2.0.21/plugins/python/python_plugin.c 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/plugins/python/python_plugin.c 2023-07-27 17:34:12.000000000 +0200 @@ -554,7 +554,7 @@ #ifdef HAS_NO_ERRORS_IN_PyFile_FromFd PyObject *new_stdprint = PyFile_FromFd(2, NULL, "w", _IOLBF, NULL, NULL, 0); #else - PyObject *new_stdprint = PyFile_FromFd(2, NULL, "w", _IOLBF, NULL, NULL, NULL, 0); + PyObject *new_stdprint = PyFile_FromFd(2, NULL, "w", _IOLBF, NULL, "backslashreplace", NULL, 0); #endif PyDict_SetItemString(pysys_dict, "stdout", new_stdprint); PyDict_SetItemString(pysys_dict, "__stdout__", new_stdprint); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/plugins/rack/rack_api.c new/uwsgi-2.0.22/plugins/rack/rack_api.c --- old/uwsgi-2.0.21/plugins/rack/rack_api.c 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/plugins/rack/rack_api.c 2023-07-27 17:34:12.000000000 +0200 @@ -7,13 +7,13 @@ #define uwsgi_rack_api(x, y, z) rb_define_module_function(rb_uwsgi_embedded, x, y, z) -static VALUE rack_uwsgi_metric_get(VALUE *class, VALUE key) { +static VALUE rack_uwsgi_metric_get(VALUE class, VALUE key) { Check_Type(key, T_STRING); int64_t value = uwsgi_metric_get(RSTRING_PTR(key), NULL); return LONG2NUM(value); } -static VALUE rack_uwsgi_metric_set(VALUE *class, VALUE key, VALUE val) { +static VALUE rack_uwsgi_metric_set(VALUE class, VALUE key, VALUE val) { Check_Type(key, T_STRING); Check_Type(val, T_FIXNUM); // should be T_BIGNUM... if (uwsgi_metric_set(RSTRING_PTR(key), NULL, NUM2LONG(val) )) { @@ -22,7 +22,7 @@ return Qtrue; } -static VALUE rack_uwsgi_metric_inc(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_metric_inc(int argc, VALUE *argv, VALUE class) { int64_t value = 1; if (argc == 0) return Qnil; Check_Type(argv[0], T_STRING); @@ -38,7 +38,7 @@ return Qtrue; } -static VALUE rack_uwsgi_metric_dec(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_metric_dec(int argc, VALUE *argv, VALUE class) { int64_t value = 1; if (argc == 0) return Qnil; Check_Type(argv[0], T_STRING); @@ -54,7 +54,7 @@ return Qtrue; } -static VALUE rack_uwsgi_metric_mul(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_metric_mul(int argc, VALUE *argv, VALUE class) { int64_t value = 1; if (argc == 0) return Qnil; Check_Type(argv[0], T_STRING); @@ -70,7 +70,7 @@ return Qtrue; } -static VALUE rack_uwsgi_metric_div(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_metric_div(int argc, VALUE *argv, VALUE class) { int64_t value = 1; if (argc == 0) return Qnil; Check_Type(argv[0], T_STRING); @@ -89,7 +89,7 @@ -static VALUE rack_uwsgi_warning(VALUE *class, VALUE rbmessage) { +static VALUE rack_uwsgi_warning(VALUE class, VALUE rbmessage) { Check_Type(rbmessage, T_STRING); char *message = RSTRING_PTR(rbmessage); @@ -108,14 +108,14 @@ return Qnil; } -static VALUE rack_uwsgi_user_harakiri(VALUE *class, VALUE sec) { +static VALUE rack_uwsgi_user_harakiri(VALUE class, VALUE sec) { Check_Type(sec, T_FIXNUM); set_user_harakiri(NUM2INT(sec)); return Qnil; } -static VALUE rack_uwsgi_log(VALUE *class, VALUE msg) { +static VALUE rack_uwsgi_log(VALUE class, VALUE msg) { Check_Type(msg, T_STRING); @@ -124,7 +124,7 @@ return Qnil; } -static VALUE rack_uwsgi_i_am_the_spooler(VALUE *class) { +static VALUE rack_uwsgi_i_am_the_spooler(VALUE class) { if (uwsgi.i_am_a_spooler) { return Qtrue; } @@ -132,7 +132,7 @@ } #ifdef UWSGI_SSL -static VALUE rack_uwsgi_i_am_the_lord(VALUE *class, VALUE legion_name) { +static VALUE rack_uwsgi_i_am_the_lord(VALUE class, VALUE legion_name) { Check_Type(legion_name, T_STRING); if (uwsgi_legion_i_am_the_lord(RSTRING_PTR(legion_name))) { return Qtrue; @@ -141,14 +141,14 @@ } #endif -static VALUE rack_uwsgi_connection_fd(VALUE *class) { +static VALUE rack_uwsgi_connection_fd(VALUE class) { struct wsgi_request *wsgi_req = current_wsgi_req(); return INT2NUM(wsgi_req->fd); } -static VALUE rack_uwsgi_setprocname(VALUE *class, VALUE rbname) { +static VALUE rack_uwsgi_setprocname(VALUE class, VALUE rbname) { Check_Type(rbname, T_STRING); char *name = RSTRING_PTR(rbname); @@ -157,7 +157,7 @@ return Qnil; } -static VALUE rack_uwsgi_mem(VALUE *class) { +static VALUE rack_uwsgi_mem(VALUE class) { uint64_t rss=0, vsz = 0; VALUE ml = rb_ary_new2(2); @@ -171,23 +171,23 @@ } -static VALUE rack_uwsgi_request_id(VALUE *class) { +static VALUE rack_uwsgi_request_id(VALUE class) { return ULONG2NUM(uwsgi.workers[uwsgi.mywid].requests); } -static VALUE rack_uwsgi_worker_id(VALUE *class) { +static VALUE rack_uwsgi_worker_id(VALUE class) { return INT2NUM(uwsgi.mywid); } -static VALUE rack_uwsgi_mule_id(VALUE *class) { +static VALUE rack_uwsgi_mule_id(VALUE class) { return INT2NUM(uwsgi.muleid); } -static VALUE rack_uwsgi_logsize(VALUE *class) { +static VALUE rack_uwsgi_logsize(VALUE class) { return ULONG2NUM(uwsgi.shared->logsize); } -static VALUE rack_uwsgi_mule_msg(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_mule_msg(int argc, VALUE *argv, VALUE class) { int fd = -1; int mule_id = -1; @@ -266,7 +266,7 @@ return 0; } -static VALUE rack_uwsgi_mule_get_msg(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_mule_get_msg(int argc, VALUE *argv, VALUE class) { int manage_signals = 1; int manage_farms = 1; @@ -322,7 +322,7 @@ } -static VALUE rack_uwsgi_lock(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_lock(int argc, VALUE *argv, VALUE class) { int lock_num = 0; @@ -340,7 +340,7 @@ return Qnil; } -static VALUE rack_uwsgi_unlock(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_unlock(int argc, VALUE *argv, VALUE class) { int lock_num = 0; @@ -362,7 +362,7 @@ -static VALUE rack_uwsgi_cache_set(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_set(int argc, VALUE *argv, VALUE class) { if (argc < 2) goto error; @@ -398,7 +398,7 @@ } -static VALUE rack_uwsgi_cache_update(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_update(int argc, VALUE *argv, VALUE class) { if (argc < 2) goto error; @@ -435,7 +435,7 @@ } -static VALUE rack_uwsgi_cache_set_exc(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_set_exc(int argc, VALUE *argv, VALUE class) { VALUE ret = rack_uwsgi_cache_set(argc, argv, class); if (ret == Qnil) { rb_raise(rb_eRuntimeError, "unable to set value in uWSGI cache"); @@ -443,7 +443,7 @@ return ret; } -static VALUE rack_uwsgi_cache_update_exc(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_update_exc(int argc, VALUE *argv, VALUE class) { VALUE ret = rack_uwsgi_cache_update(argc, argv, class); if (ret == Qnil) { rb_raise(rb_eRuntimeError, "unable to update value in uWSGI cache"); @@ -451,7 +451,7 @@ return ret; } -static VALUE rack_uwsgi_cache_del(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_del(int argc, VALUE *argv, VALUE class) { if (argc == 0) goto error; @@ -477,7 +477,7 @@ return Qnil; } -static VALUE rack_uwsgi_cache_del_exc(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_del_exc(int argc, VALUE *argv, VALUE class) { VALUE ret = rack_uwsgi_cache_del(argc, argv, class); if (ret == Qnil) { rb_raise(rb_eRuntimeError, "unable to delete object from uWSGI cache"); @@ -487,7 +487,7 @@ -static VALUE rack_uwsgi_cache_exists(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_exists(int argc, VALUE *argv, VALUE class) { if (argc == 0) goto error; @@ -515,7 +515,7 @@ -static VALUE rack_uwsgi_cache_clear(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_clear(int argc, VALUE *argv, VALUE class) { char *cache = NULL; @@ -531,7 +531,7 @@ return Qnil; } -static VALUE rack_uwsgi_cache_clear_exc(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_clear_exc(int argc, VALUE *argv, VALUE class) { VALUE ret = rack_uwsgi_cache_clear(argc, argv, class); if (ret == Qnil) { rb_raise(rb_eRuntimeError, "unable to clear the uWSGI cache"); @@ -541,7 +541,7 @@ -static VALUE rack_uwsgi_cache_get(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_get(int argc, VALUE *argv, VALUE class) { if (argc == 0) goto error; @@ -571,7 +571,7 @@ } -static VALUE rack_uwsgi_cache_get_exc(int argc, VALUE *argv, VALUE *class) { +static VALUE rack_uwsgi_cache_get_exc(int argc, VALUE *argv, VALUE class) { VALUE ret = rack_uwsgi_cache_get(argc, argv, class); if (ret == Qnil) { rb_raise(rb_eRuntimeError, "unable to get value from uWSGI cache"); @@ -582,7 +582,7 @@ -static VALUE rack_uwsgi_add_cron(VALUE *class, VALUE rbsignum, VALUE rbmin, VALUE rbhour, VALUE rbday, VALUE rbmon, VALUE rbweek) { +static VALUE rack_uwsgi_add_cron(VALUE class, VALUE rbsignum, VALUE rbmin, VALUE rbhour, VALUE rbday, VALUE rbmon, VALUE rbweek) { Check_Type(rbsignum, T_FIXNUM); Check_Type(rbmin, T_FIXNUM); @@ -608,7 +608,7 @@ -static VALUE rack_uwsgi_add_timer(VALUE *class, VALUE rbsignum, VALUE secs) { +static VALUE rack_uwsgi_add_timer(VALUE class, VALUE rbsignum, VALUE secs) { Check_Type(rbsignum, T_FIXNUM); Check_Type(secs, T_FIXNUM); @@ -626,7 +626,7 @@ -static VALUE rack_uwsgi_add_rb_timer(VALUE *class, VALUE rbsignum, VALUE secs) { +static VALUE rack_uwsgi_add_rb_timer(VALUE class, VALUE rbsignum, VALUE secs) { Check_Type(rbsignum, T_FIXNUM); Check_Type(secs, T_FIXNUM); @@ -644,7 +644,7 @@ } -static VALUE rack_uwsgi_alarm(VALUE *class, VALUE alarm, VALUE msg) { +static VALUE rack_uwsgi_alarm(VALUE class, VALUE alarm, VALUE msg) { Check_Type(alarm, T_STRING); Check_Type(msg, T_STRING); @@ -654,7 +654,7 @@ return Qnil; } -static VALUE rack_uwsgi_add_file_monitor(VALUE *class, VALUE rbsignum, VALUE rbfilename) { +static VALUE rack_uwsgi_add_file_monitor(VALUE class, VALUE rbsignum, VALUE rbfilename) { Check_Type(rbsignum, T_FIXNUM); Check_Type(rbfilename, T_STRING); @@ -671,7 +671,7 @@ } -static VALUE uwsgi_ruby_wait_fd_read(VALUE *class, VALUE arg1, VALUE arg2) { +static VALUE uwsgi_ruby_wait_fd_read(VALUE class, VALUE arg1, VALUE arg2) { Check_Type(arg1, T_FIXNUM); Check_Type(arg2, T_FIXNUM); @@ -689,7 +689,7 @@ return Qtrue; } -static VALUE uwsgi_ruby_wait_fd_write(VALUE *class, VALUE arg1, VALUE arg2) { +static VALUE uwsgi_ruby_wait_fd_write(VALUE class, VALUE arg1, VALUE arg2) { Check_Type(arg1, T_FIXNUM); Check_Type(arg2, T_FIXNUM); @@ -706,7 +706,7 @@ return Qtrue; } -static VALUE uwsgi_ruby_async_connect(VALUE *class, VALUE arg) { +static VALUE uwsgi_ruby_async_connect(VALUE class, VALUE arg) { Check_Type(arg, T_STRING); @@ -716,7 +716,7 @@ } -static VALUE uwsgi_ruby_async_sleep(VALUE *class, VALUE arg) { +static VALUE uwsgi_ruby_async_sleep(VALUE class, VALUE arg) { Check_Type(arg, T_FIXNUM); @@ -730,7 +730,7 @@ return Qtrue; } -static VALUE uwsgi_ruby_masterpid(VALUE *class) { +static VALUE uwsgi_ruby_masterpid(VALUE class) { if (uwsgi.master_process) { return INT2NUM(uwsgi.workers[0].pid); @@ -738,7 +738,7 @@ return INT2NUM(0); } -static VALUE uwsgi_ruby_suspend(VALUE *class) { +static VALUE uwsgi_ruby_suspend(VALUE class) { struct wsgi_request *wsgi_req = current_wsgi_req(); @@ -749,7 +749,7 @@ } -static VALUE uwsgi_ruby_signal_wait(int argc, VALUE *argv, VALUE *class) { +static VALUE uwsgi_ruby_signal_wait(int argc, VALUE *argv, VALUE class) { struct wsgi_request *wsgi_req = current_wsgi_req(); int wait_for_specific_signal = 0; @@ -781,7 +781,7 @@ return Qnil; } -static VALUE uwsgi_ruby_signal_received(VALUE *class) { +static VALUE uwsgi_ruby_signal_received(VALUE class) { struct wsgi_request *wsgi_req = current_wsgi_req(); @@ -789,7 +789,7 @@ } -static VALUE uwsgi_ruby_signal_registered(VALUE *class, VALUE signum) { +static VALUE uwsgi_ruby_signal_registered(VALUE class, VALUE signum) { Check_Type(signum, T_FIXNUM); @@ -802,7 +802,7 @@ return Qfalse; } -static VALUE uwsgi_ruby_do_rpc(int argc, VALUE *rpc_argv, VALUE *class) { +static VALUE uwsgi_ruby_do_rpc(int argc, VALUE *rpc_argv, VALUE class) { char *node = NULL, *func; uint64_t size = 0; @@ -853,7 +853,7 @@ return Qnil; } -static VALUE uwsgi_ruby_register_rpc(int argc, VALUE *argv, VALUE *class) { +static VALUE uwsgi_ruby_register_rpc(int argc, VALUE *argv, VALUE class) { int rb_argc = 0; @@ -879,7 +879,7 @@ return Qtrue; } -static VALUE uwsgi_ruby_register_signal(VALUE *class, VALUE signum, VALUE sigkind, VALUE rbhandler) { +static VALUE uwsgi_ruby_register_signal(VALUE class, VALUE signum, VALUE sigkind, VALUE rbhandler) { Check_Type(signum, T_FIXNUM); Check_Type(sigkind, T_STRING); @@ -899,7 +899,7 @@ } -static VALUE uwsgi_ruby_signal(int argc, VALUE *argv, VALUE *class) { +static VALUE uwsgi_ruby_signal(int argc, VALUE *argv, VALUE class) { if (argc < 1) { rb_raise(rb_eRuntimeError, "you have to specify a signum"); @@ -967,7 +967,7 @@ } -static VALUE rack_uwsgi_send_spool(VALUE *class, VALUE args) { +static VALUE rack_uwsgi_send_spool(VALUE class, VALUE args) { char *body = NULL; size_t body_len= 0; @@ -1005,7 +1005,7 @@ } -static VALUE uwsgi_ruby_websocket_handshake(int argc, VALUE *argv, VALUE *class) { +static VALUE uwsgi_ruby_websocket_handshake(int argc, VALUE *argv, VALUE class) { struct wsgi_request *wsgi_req = current_wsgi_req(); @@ -1034,7 +1034,7 @@ return Qnil; } -static VALUE uwsgi_ruby_websocket_send(VALUE *class, VALUE *msg) { +static VALUE uwsgi_ruby_websocket_send(VALUE class, VALUE msg) { Check_Type(msg, T_STRING); char *message = RSTRING_PTR(msg); size_t message_len = RSTRING_LEN(msg); @@ -1045,7 +1045,7 @@ return Qnil; } -static VALUE uwsgi_ruby_websocket_recv(VALUE *class) { +static VALUE uwsgi_ruby_websocket_recv(VALUE class) { struct wsgi_request *wsgi_req = current_wsgi_req(); struct uwsgi_buffer *ub = uwsgi_websocket_recv(wsgi_req); @@ -1059,7 +1059,7 @@ } -static VALUE uwsgi_ruby_websocket_recv_nb(VALUE *class) { +static VALUE uwsgi_ruby_websocket_recv_nb(VALUE class) { struct wsgi_request *wsgi_req = current_wsgi_req(); struct uwsgi_buffer *ub = uwsgi_websocket_recv_nb(wsgi_req); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/plugins/rack/rack_plugin.c new/uwsgi-2.0.22/plugins/rack/rack_plugin.c --- old/uwsgi-2.0.21/plugins/rack/rack_plugin.c 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/plugins/rack/rack_plugin.c 2023-07-27 17:34:12.000000000 +0200 @@ -208,7 +208,7 @@ return self; } -VALUE rb_uwsgi_io_gets(VALUE obj, VALUE args) { +VALUE rb_uwsgi_io_gets(VALUE obj) { struct wsgi_request *wsgi_req; Data_Get_Struct(obj, struct wsgi_request, wsgi_req); @@ -222,14 +222,14 @@ return Qnil; } -VALUE rb_uwsgi_io_each(VALUE obj, VALUE args) { +VALUE rb_uwsgi_io_each(VALUE obj) { if (!rb_block_given_p()) rb_raise(rb_eArgError, "Expected block on rack.input 'each' method"); // yield strings chunks for(;;) { - VALUE chunk = rb_uwsgi_io_gets(obj, Qnil); + VALUE chunk = rb_uwsgi_io_gets(obj); if (chunk == Qnil) { return Qnil; } @@ -273,7 +273,7 @@ return Qnil; } -VALUE rb_uwsgi_io_rewind(VALUE obj, VALUE args) { +VALUE rb_uwsgi_io_rewind(VALUE obj) { struct wsgi_request *wsgi_req; Data_Get_Struct(obj, struct wsgi_request, wsgi_req); @@ -454,9 +454,13 @@ } -static void rack_hack_dollar_zero(VALUE name, ID id) { +static void rack_hack_dollar_zero(VALUE name, ID id, VALUE *_) { ur.dollar_zero = rb_obj_as_string(name); + // From ruby 2.7 onwards this is a noop, from ruby 3.2 onwards + // this function no longer exists +#if !defined(RUBY27) rb_obj_taint(ur.dollar_zero); +#endif } #ifndef RUBY19 @@ -698,7 +702,7 @@ } -static VALUE send_body(VALUE obj) { +static VALUE send_body(VALUE obj, VALUE data, int argc, const VALUE *argv, VALUE blockarg) { struct wsgi_request *wsgi_req = current_wsgi_req(); @@ -731,7 +735,7 @@ #endif } -VALUE send_header(VALUE obj, VALUE headers) { +VALUE send_header(VALUE obj, VALUE headers, int argc, const VALUE *argv, VALUE blockarg) { struct wsgi_request *wsgi_req = current_wsgi_req(); @@ -792,7 +796,7 @@ VALUE iterate_headers(VALUE headers) { #ifdef RUBY19 - return rb_block_call(headers, rb_intern("each"), 0, 0, send_header, headers ); + return rb_block_call(headers, rb_intern("each"), 0, 0, send_header, headers); #else return rb_iterate(rb_each, headers, send_header, headers); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/plugins/rack/uwsgiplugin.py new/uwsgi-2.0.22/plugins/rack/uwsgiplugin.py --- old/uwsgi-2.0.21/plugins/rack/uwsgiplugin.py 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/plugins/rack/uwsgiplugin.py 2023-07-27 17:34:12.000000000 +0200 @@ -17,6 +17,8 @@ if (v[0] == '1' and v[1] == '9') or v[0] >= '2': CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split() CFLAGS.append('-DRUBY19') + if version >= '2.7': + CFLAGS.append('-DRUBY27') CFLAGS.append('-Wno-unused-parameter') rbconfig = 'RbConfig' else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/plugins/ruby19/uwsgiplugin.py new/uwsgi-2.0.22/plugins/ruby19/uwsgiplugin.py --- old/uwsgi-2.0.21/plugins/ruby19/uwsgiplugin.py 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/plugins/ruby19/uwsgiplugin.py 2023-07-27 17:34:12.000000000 +0200 @@ -14,9 +14,11 @@ GCC_LIST = ['../rack/rack_plugin', '../rack/rack_api'] -if v[0] == '1' and v[1] == '9': +if (v[0] == '1' and v[1] == '9') or v[0] >= '2': CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split() CFLAGS.append('-DRUBY19') + if version >= '2.7': + CFLAGS.append('-DRUBY27') CFLAGS.append('-Wno-unused-parameter') rbconfig = 'RbConfig' else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/tests/harakiri.py new/uwsgi-2.0.22/tests/harakiri.py --- old/uwsgi-2.0.21/tests/harakiri.py 1970-01-01 01:00:00.000000000 +0100 +++ new/uwsgi-2.0.22/tests/harakiri.py 2023-07-27 17:34:12.000000000 +0200 @@ -0,0 +1,25 @@ +# ./uwsgi --master --http :8080 --harakiri 1 --wsgi-file tests/harakiri.py --harakiri-graceful-timeout 1 --py-call-osafterfork --lazy-apps --enable-threads --threads 2 --harakiri-graceful-signal 31 +import time +import uwsgi +import signal +import sys +import atexit + +def sig_handler(n, fp): + print("[Python App] attempting graceful shutdown triggered by harakiri (signal %d)" % n) + exit(1) + +def application(e, s): + print("[Python App] sleeping") + time.sleep(3) + s('200 OK', [('Content-Type', 'text/html')]) + return [b"OK"] + + +def exit_handler(): + time.sleep(3) + # Should not reach this line (graceful harakiri deadline expired) + print("[Python App] exiting now") + +atexit.register(exit_handler) +signal.signal(signal.SIGSYS, sig_handler) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/uwsgi.gemspec new/uwsgi-2.0.22/uwsgi.gemspec --- old/uwsgi-2.0.21/uwsgi.gemspec 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/uwsgi.gemspec 2023-07-27 17:34:12.000000000 +0200 @@ -2,7 +2,7 @@ s.name = 'uwsgi' s.license = 'GPL-2' s.version = `python -c "import uwsgiconfig as uc; print uc.uwsgi_version"`.sub(/-dev-.*/,'') - s.date = '2022-10-24' + s.date = '2023-07-27' s.summary = "uWSGI" s.description = "The uWSGI server for Ruby/Rack" s.authors = ["Unbit"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/uwsgi.h new/uwsgi-2.0.22/uwsgi.h --- old/uwsgi-2.0.21/uwsgi.h 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/uwsgi.h 2023-07-27 17:34:12.000000000 +0200 @@ -2439,7 +2439,7 @@ int master_queue; int master_interval; - // mainly iseful for broodlord mode + // mainly useful for broodlord mode int vassal_sos_backlog; int no_defer_accept; @@ -2852,6 +2852,11 @@ struct uwsgi_buffer *websockets_continuation_buffer; uint64_t max_worker_lifetime_delta; + + // uWSGI 2.0.22 + int harakiri_graceful_timeout; + int harakiri_graceful_signal; + int harakiri_queue_threshold; }; struct uwsgi_rpc { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uwsgi-2.0.21/uwsgiconfig.py new/uwsgi-2.0.22/uwsgiconfig.py --- old/uwsgi-2.0.21/uwsgiconfig.py 2022-10-24 12:21:58.000000000 +0200 +++ new/uwsgi-2.0.22/uwsgiconfig.py 2023-07-27 17:34:12.000000000 +0200 @@ -1,6 +1,6 @@ # uWSGI build system -uwsgi_version = '2.0.21' +uwsgi_version = '2.0.22' import os import re
