diff -ru5 Quixote-0.7a3/publish.py quixote/publish.py --- Quixote-0.7a3/publish.py 2003-12-03 17:30:29.000000000 -0600 +++ quixote/publish.py 2004-02-24 15:40:13.000000000 -0600 @@ -503,11 +503,21 @@ Process a single request, given an HTTPRequest object. The try_publish() method will be called to do the work and exceptions will be handled here. """ self._set_request(request) - output = self.try_publish(request, env.get('PATH_INFO', '')) + + try: + self.parse_request(request) + output = self.try_publish(request, env.get('PATH_INFO', '')) + except errors.PublishError, exc: + # Exit the publishing loop and return a result right away. + output = self.finish_interrupted_request(request, exc) + except: + # Some other exception, generate error messages to the logs, etc. + output = self.finish_failed_request(request) + self.log_request(request) if output and self.config.compress_pages: output = self.compress_output(request, str(output)) @@ -519,20 +529,12 @@ Create an HTTPRequest object from the environment and from standard input, process it, and write the response to standard output. """ request = self.create_request(stdin, env) - try: - self.parse_request(request) - output = self.process_request(request, env) - except errors.PublishError, exc: - # Exit the publishing loop and return a result right away. - output = self.finish_interrupted_request(request, exc) - except: - # Some other exception, generate error messages to the logs, etc. - output = self.finish_failed_request(request) - + output = self.process_request(request, env) + # Output results from Response object if output: request.response.set_body(output) try: request.response.write(stdout) diff -ru5 Quixote-0.7a3/server/medusa_http.py quixote/server/medusa_http.py --- Quixote-0.7a3/server/medusa_http.py 2004-02-16 12:04:21.000000000 -0600 +++ quixote/server/medusa_http.py 2004-02-24 16:12:21.000000000 -0600 @@ -103,17 +103,11 @@ if v == None: environ[k] = '' stdin = StringIO(data) qreq = self.publisher.create_request(stdin, environ) - try: - self.publisher.parse_request(qreq) - output = self.publisher.process_request(qreq, environ) - except PublishError, err: - output = self.publisher.finish_interrupted_request(qreq, err) - except: - output = self.publisher.finish_failed_request(qreq) + output = self.publisher.process_request(qreq, environ) qresponse = qreq.response if output: qresponse.set_body(output) diff -ru5 Quixote-0.7a3/server/twisted_http.py quixote/server/twisted_http.py --- Quixote-0.7a3/server/twisted_http.py 2003-12-03 17:30:29.000000000 -0600 +++ quixote/server/twisted_http.py 2004-02-24 15:37:23.000000000 -0600 @@ -47,21 +47,11 @@ """ Warning, this sidesteps the Publisher.publish method, Hope you didn't override it... """ pub = self.publisher - try: - pub.parse_request(qxrequest) - output = pub.process_request(qxrequest, env) - # needed for session management! - pub.finish_successful_request(qxrequest) - except errors.PublishError, exc: - # Exit the publishing loop and return a result right away. - output = pub.finish_interrupted_request(qxrequest, exc) - except: - # other exception, generate error messages to logs, etc. - output = pub.finish_failed_request(qxrequest) + output = pub.process_request(qxrequest, env) # don't write out the output, just set the response body # the calling method will do the rest. if output: if isinstance(output, Stream):