Re: dump and response population
Michiel Boland <[email protected]>
| Newsgroups | gmane.network.mathopd |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 21 Mar 2002, Toby DiPasquale wrote: > Date: Thu, 21 Mar 2002 12:03:08 -0500 (EST) > From: Toby DiPasquale <[email protected]> > To: [email protected] > Subject: dump and response population > > Hi all, > > I have two quick questions for the community: > > 1) How do I activate the process_dump functionality? I tried adding this > line to the configuration file, but it didn't work: > > Specials { > Imagemap { map } > CGI { cgi } > Redirect { url } > Dump { dmp } > } > > I'd like to see this in action, but I get no hints as to how to activate > it from the source code. Put a file with extension 'dmp' somewhere where it is visible through the web server, and then load that into your browser, e.g. with something like http://an.example/test.dmp That should work. > 2) I've noticed that it is the fill_connection() and write_connection() > functions that are responsible for the actual writing of the response data > back out to socket. What fields in the (struct request *) structure would > I have to populate to be able to have it pick up my output and send it > back out? I've noticed that some of the handlers use r->cn->rfd to pass a > file descriptor back to mathopd. And dump uses a temporary file to pass > back to the rfd value. But then cgi.c does not, nor does imap.c. Is there > a universal way for me to put some data in a temporary file or buffer and > have it picked up for delivery back out to the client? The universal way would be more or less what is in dump.c. You open a file descriptor, put it in r->cn->fd, make sure that its file offset is at 0. Then you populate r->content_length, r->last_modified, r->content_type and r->num_content. The r->num_content should be zero of more; if you don't set it strange things will probably happen. HTH Cheers Michiel