leejo / cgi-fast

The new home for CGI::Fast, removing it from the original CGI.pm distribution
4 stars 5 forks source link

CGI::Fast vs. Cs STDOUT [rt.cpan.org #94423] #4

Closed leejo closed 10 years ago

leejo commented 10 years ago

https://rt.cpan.org/Ticket/Display.html?id=94423

Hi,

Just switched a program from CGI to CGI+CGI::Fast (3.52, 1.08).  The program uses RRDs::graph to generate plots.

RRDs::graph has always been asked to write output to "-".  This now ends in the fastcgi servers error.log. This is not so strange because:

# ls -l /proc/29271/fd
total 0
lrwx------ 1 www-data www-data 64 april  4 09:34 0 -> socket:[167469517]
l-wx------ 1 www-data www-data 64 april  4 09:34 1 -> /var/log/apache2/error.log
lr-x------ 1 www-data www-data 64 april  4 09:34 12 -> pipe:[167465616]
l-wx------ 1 www-data www-data 64 april  4 09:34 15 -> pipe:[167465617]
l-wx------ 1 www-data www-data 64 april  4 09:34 2 -> /var/log/apache2/error.log
lrwx------ 1 www-data www-data 64 april  4 09:34 3 -> socket:[167468310]

So the C code is writing to Cs STDOUT and FCGI/CGI::Fast fools with file descriptors, more than just CGI does.

It would be more according to the Principle of Least Surprise if filedescriptor 1 also pointed back to the client channel.

(in the mean time I'm sending the PNG files via a disk file and then sysread/syswriting it to perls STDOUT.)

Regards,
  Nicolai