durusmail: quixote-users: updated version of twisted/quixote script
updated version of twisted/quixote script
2002-06-12
2002-06-12
2002-06-12
2002-06-13
updated version of twisted/quixote script
Greg Ward
2002-06-13
On 12 June 2002, Michael Smith said:
> My solution was the following post-publish() code:
>
>         publisher.publish(stdin, stdout, stderr, environ)
>         output = stdout.getvalue()
>
>         #self.setResponseCode(request.response.status_code)
>         #for hdr, value in request.response.headers.items():
>         #    self.setHeader(hdr, value)
>         self.startedWriting = 1
>         self.write(output.replace("Status:", "HTTP/1.1"))
>         self.finish()
>
> The commented out parts prevent the Matrix headers from going into the
> response. You then have to call the set "startWriting" to make Matrix
> think the headers have already been written. There's also a "convert
> CGI status to http status" hack as well.

It looks to me like you're changing a CGI response to an HTTP response.
That seems like a reasonably, if kludgey, thing to do when Quixote is
running directly inside an HTTP server rather than through a CGI-ish
interface.  I suppose Quixote should be able to speak HTTP directly.
Would that solve this problem?

        Greg



reply