Project

General

Profile

Feature #2313

[PATCH] X-sendfile support for mod_cgi

Added by Max_nl over 6 years ago. Updated over 1 year ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
mod_cgi
Target version:
Start date:
2011-05-08
Due date:
% Done:

100%

Estimated time:
Missing in 1.5.x:
No

Description

Attached a patch to add x-sendfile support to mod_cgi.
Works the same as with Fastcgi.

cgi_x-send-file.patch (4.79 KB) cgi_x-send-file.patch Max_nl, 2011-05-08 19:03

Associated revisions

Revision 1f23ba9a (diff)
Added by gstrauss over 1 year ago

[mod_cgi] X-Sendfile feature (fixes #2313)

handle X-Sendfile with http_response_xsendfile() if
cgi.x-sendfile = "enable"

x-ref:
"X-sendfile support for mod_cgi"
https://redmine.lighttpd.net/issues/2313

Revision c380d227
Added by gstrauss over 1 year ago

[mod_cgi,mod_fastcgi,mod_scgi] X-Sendfile features

[core] http_response_send_file() shared code (#2017)
[mod_fastcgi] use http_response_xsendfile()
(fixes #799, fixes #851, fixes #2017, fixes #2076)
[mod_scgi] X-Sendfile feature (fixes #2253)
[mod_cgi] X-Sendfile feature (fixes #2313)

Merge branch 'feature-2017-http_response_send_file' into master

github: closes #59

History

#1

Updated by Max_nl over 6 years ago

Same patch but in unified format (forgot the -u option).

#2

Updated by stbuehler over 6 years ago

  • File deleted (cgi_x-send-file.patch)
#3

Updated by stbuehler over 6 years ago

  • Target version changed from 1.4.29 to 1.4.x

Hm. I don't think it is worth it to add more complexity to mod_cgi (especially as the more powerful variant of x-sendfile is missing).

I recommend using fcgi-cgi instead; it comes with the bonus that you can run the scripts with a different user easily.
That way, your cgi apps would look like FastCGI to lighty.

#4

Updated by Max_nl over 6 years ago

stbuehler wrote:

I recommend using fcgi-cgi instead; it comes with the bonus that you can run the scripts with a different user easily.
That way, your cgi apps would look like FastCGI to lighty.

It's for an embedded application where memory use is an issue.
Having to install spawn-fci, fcgi-cgi and libev just to be able to serve files, isn't going to help with that.

mod_cgi without x-sendfile is pretty worthless. Serve a file through a script that is larger than the device memory and it crashes due to lighttpd's tendency to buffer script output indefinitely.

#5

Updated by stbuehler over 6 years ago

spawn-fcgi is not a memory issue (it is only a spawn helper and doesn't keep running), and mod_cgi needs memory too. i doubt there will be a big difference.

if you prefer using your patch that is fine ofc, but i don't want to maintain another copy of x-sendfile.

#6

Updated by nitrox over 6 years ago

  • Status changed from New to Wontfix
#7

Updated by stbuehler over 6 years ago

  • Target version deleted (1.4.x)
#8

Updated by gstrauss over 1 year ago

  • Status changed from Wontfix to Patch Pending
  • Target version set to 1.4.40
#9

Updated by gstrauss over 1 year ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100

Also available in: Atom