Project

General

Profile

Feature #2253

scgi x-sendfile

Added by jroll about 7 years ago. Updated over 1 year ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
mod_scgi
Target version:
Start date:
2010-08-26
Due date:
% Done:

100%

Estimated time:
Missing in 1.5.x:
No

Description

I have copied some code from mod_fastcgi.c in to mod_scgi.c to allow the X-Sendfile header to work. Since I know nothing about lighttpd internals this is just a shot in the dark, but it does seem to send the correct data to my browser.

One issue I've discovered is that if the file lookup with stat_cache_get_entry fails, the server sends an empty file, not a 502 error code as intended.

Anyway this is a start. If someone familiar with lighttpd/scgi would like to give feedback I'd be happy to revise the patch as needed.

diffs against lighttpd-1.4.27

Thanks,

john

mod_scgi.c-xsendfile-patch (3.67 KB) mod_scgi.c-xsendfile-patch jroll, 2010-08-26 15:36

Related issues

Related to Feature #2017: X-Sendfile handoff to mod-static-file in 1.4.xFixed2009-07-01

Associated revisions

Revision 0a907c64 (diff)
Added by gstrauss over 1 year ago

[mod_scgi] X-Sendfile feature (fixes #2253)

handle X-Sendfile with http_response_xsendfile() if host configured
( "x-sendfile" = "enable" )

x-ref:
"scgi x-sendfile"
https://redmine.lighttpd.net/issues/2253

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 Olaf-van-der-Spek about 7 years ago

jroll wrote:

One issue I've discovered is that if the file lookup with stat_cache_get_entry fails, the server sends an empty file, not a 502 error code as intended.

Didn't that get fixed in FastCGI recently?

#2 Updated by jroll about 7 years ago

I see that something like this was fixed for fastcgi in #2226. I don't know how to see the code changes that were applied of fix this.

I tried setting cos->parsed_response |= HTTP_STATUS; but this didn't seem to help.

John

#4 Updated by arteymix over 1 year ago

What is the state of X-Sendfile with mod_scgi?

It still does not work with 1.4.39.

#5 Updated by gstrauss over 1 year ago

  • Related to Feature #2017: X-Sendfile handoff to mod-static-file in 1.4.x added

#6 Updated by gstrauss over 1 year ago

  • Status changed from New to Patch Pending
  • Target version set to 1.4.40

#7 Updated by gstrauss over 1 year ago

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

Also available in: Atom