about summary refs log tree commit homepage
path: root/extras/exec_cgi.rb
DateCommit message (Collapse)
2022-12-25extras/exec_cgi: fix for newer Rack::ContentLength
Rack::ContentLength now unconditionally captures bodies and doesn't dup the data yield by body#each. Thus we can't reuse buffers anymore.
2018-12-28extras/exec_cgi: remove unecessary .freeze calls
Operations via Array#map are NOT optimized away by opt_str_lit in the VM, and they're unnecessary anyways with the "frozen_string_literal: true" comment in Ruby 2.3+.
2018-12-28extras/exec_cgi: support Process.spawn options (e.g. RLIMIT_*)
These options can be useful for limiting CGI process runtime and memory usage.
2018-12-27extras/exec_cgi: @body_tip is always set
No point in increasing the complexity for cases it's not.
2018-12-27extras/exec_cgi: update copyright year and use SPDX
Machine-parseability is useful for licenses.
2018-12-27extras/exec_cgi: remove kgio dependency
We don't need non-blocking I/O at all in this module and it's not coupled with the rest of yahns at all.
2016-08-05extras/exec_cgi: fix for HTTPoxy vulnerability
Bad clients may set the Proxy: header in the response and cause any CGI programs we execute to use the value of that header as the HTTP proxy. This affects folks calling code which respects the HTTP_PROXY environment variable in CGI programs. ref: https://httpoxy.org/
2016-04-30extras/exec_cgi: document cgit example
Apparently this can be useful to some people.
2016-01-03extras/exec_cgi: fix frozen string error on slow responses
Oops, we need to duplicate our buffer in case the CGI executable returns just the header :x
2016-01-02copyright updates for 2016
Using the 'update-copyright' script from gnulib[1]: git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \ UPDATE_COPYRIGHT_USE_INTERVALS=2 \ xargs /path/to/gnulib/build-aux/update-copyright We're also switching to 'GPL-3.0+' as recommended by SPDX to be consistent with our gemspec and other metadata (as opposed to the longer but equivalent "GPLv3 or later"). [1] git://git.savannah.gnu.org/gnulib.git
2016-01-02enable frozen_string_literal for Ruby 2.3+
There are likely yet-to-be-discovered bugs in here. Also, keeping explicit #freeze calls for 2.2 users, since most users have not migrated to 2.3, yet.
2015-10-13copyright updates
Future updates may use the update-copyright script in gnulib: git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \ UPDATE_COPYRIGHT_USE_INTERVALS=2 \ xargs /path/to/gnulib/build-aux/update-copyright
2014-04-21extras/exec_cgi: pass SCRIPT_NAME from Rack env
Using the full, filesystem path name to our script is wrong and not according to RFC 3875.
2014-04-21extras/exec_cgi: allow passing custom env
Sometimes a CGI script wants to run with some environment variables set or overridden. Allow it.
2013-12-22extras/exec_cgi: skip GATEWAY_INTERFACE from Rack env
We will override it internally regardless of middlewares.
2013-12-19extras/exec_cgi: document dependency on current rack.git
This was causing zombies on the bogomips.org cgit instance.
2013-11-16extras/exec_cgi: split head from body properly
The body may contain extra repeated newlines, of course
2013-11-12exec_cgi: drop chunk/content-length
Leave that up to Rack::Chunked/Rack::ContentLength. Chunking ourselves interacts badly with Rack::Deflater, since Deflater will blindly deflate already-chunked portions.
2013-11-10test: exec_cgi test uses worker_processes
Following our own advice in commit a79a6d8775171ad5cceda9bb3a77946ba60e26ce (doc: recommend worker_processes if the app uses SIGCHLD)
2013-11-07exec_cgi: release pipe/pid sooner
We don't want to leave extra resources lying around when slow clients read from us and yahns is forced to buffer. yahns delays the close of the request body until the request is fully written so response loggers can have an accurate time of how long it takes.
2013-11-06http_response: reorder wbuf_maybe on successful early flush
We can use the wbuf_close return value instead to ensure we close tmpio properly and follow the same code path as a normal (:wait_writable-triggering) buffered response would. Add a few tests to ensure we properly close the response body for exec_cgi, where I noticed zombies and started me down this rabbit hole looking for places where the response body was not closed properly.
2013-11-02add extras for exec_cgi and try_gzip_static
These applications are what I'll be using to run on yahns on my personal server. Including them here will be helpful for me to find bugs. I've already found some, the following commits were directly the result of playing with these extras: * stream_file: only close FDs we opened ourselves * worker-less server should not waitpid indiscriminately * http: do not drop Content-Range from response headers