Project

General

Profile

X-LIGHTTPD-send-file is not working

Added by dkamdar over 16 years ago

Hi,

X-LIGHTTPD-send-file option is not working on linux.

Lighttpd : 1.14.18
Build and version info: lighttpd-1.4.15 - a light and fast webserver and lua
lighttpd.conf part

fastcgi.server = ( 
"dgraph" => (
(
"socket" => "/tmp/fcgi.dgraph.socket",
"bin-path" => "/path/excustable/file"
"min-procs" => 1,
"max-procs" => 1,
"allow-x-send-file" => "enable"
}
)
)

I am getting following result while using X-LIGHTTPD-send-file option.

Case 1 : sample.c

printf( "Content-Type: image/png\n\n" );
printf( "X-LIGHTTPD-send-file: %s \n\n" , png_file_path.c_str() );
printf( "\n\n" );

Result :
It reutrn output in text file as below

X-LIGHTTPD-send-file: /tmp/doc_root/I/B/I.png

Case 2: sample.c
printf( "Content-Type: image/png\r\n" );
printf( "X-LIGHTTPD-send-file: %s \r\n" , png_file_path.c_str() );
printf( "\r\n" );

Result :
It reutns borken image

I both case difference in only "\r" in printf statement.

Anyone is having working expample of X-LIGHTTPD-send-file option.


Replies (3)

RE: X-LIGHTTPD-send-file is not working - Added by icy over 16 years ago

Double \n marks the end of the headers. Use a single \n and then an additional \n at the end.

printf( "Content-Type: image/png\n" );
printf( "X-LIGHTTPD-send-file: %s \n" , png_file_path.c_str() );
printf( "\n" );

RE: X-LIGHTTPD-send-file is not working - Added by dkamdar over 16 years ago

thanks for reply.
I tried and still getting broken image.

RE: X-LIGHTTPD-send-file is not working - Added by dkamdar over 16 years ago

Can you guys point to lighttpd general flow diagram ?
e.g
mod_magnet allow us to make modification in URL and pass it to application.
Do we have any module that can control after execution of application code?

just trying to find out X-LIGHTTPD-send-file alternate option

    (1-3/3)