Hi Felix,

I am the author of mailgraph and I am having a look at this bug-report:
http://bugs.debian.org/326014

What seems to be happening is that mailgraph.cgi is outputting a lot of
data (an image) and then quits. According to the following page:
http://www.greenend.org.uk/rjk/2001/06/poll.html
on Linux a POLLHUP is going to be sent to the other side of the pipe (the
web-server) instead of POLLIN if the application quits before the data is read.

The following is however implemented in fnord for CGI scripts:

    while(poll(pfd,nr,-1)!=-1) {
      /* read from cgi */
      if (pfd[0].revents&POLLIN) {
        ... read from fd[0] ...
        if (pfd[0].revents&POLLHUP) break;
      }
      /* write to cgi the post data */
      else if (nr>1 && pfd[1].revents&POLLOUT) {
        ... write to df[1] ...
      }
      else if (pfd[0].revents&POLLHUP) break;
      else {
        ... error ...
      }

Shouldn't you try again to read from fd[0] after a POLLHUP?

Cheers
David
-- 
David Schweikert        | phone: +41 44 632 7019
System manager ISG.EE   | walk:  ETH Zentrum, ETL F24.1
ETH Zurich, Switzerland | web:   http://people.ee.ethz.ch/dws


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to