diff options
author | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2011-04-19 09:40:23 +1000 |
---|---|---|
committer | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2011-04-19 09:40:23 +1000 |
commit | e346fd0a14a32ccffe6929b4e416eb6e6b39306e (patch) | |
tree | 769fa10f930213ed447196fd72e050884cfe309e | |
parent | dd56cff4920af492968d914ab8411695f3b6bdef (diff) | |
download | mod_wsgi-e346fd0a14a32ccffe6929b4e416eb6e6b39306e.tar.gz |
Move where content length mismatch log message generated as not picking up
case for exception properly.
-rw-r--r-- | .hgignore | 11 | ||||
-rw-r--r-- | mod_wsgi.c | 36 |
2 files changed, 29 insertions, 18 deletions
diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..8a8fd49 --- /dev/null +++ b/.hgignore @@ -0,0 +1,11 @@ +syntax: glob + +Makefile +Makefile.in +autom4te.cache +config.log +config.status +.libs +*.la +*.lo +*.slo @@ -1,7 +1,7 @@ /* vim: set sw=4 expandtab : */ /* - * Copyright 2007-2010 GRAHAM DUMPLETON + * Copyright 2007-2011 GRAHAM DUMPLETON * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -3904,6 +3904,23 @@ static int Adapter_run(AdapterObject *self, PyObject *object) Py_XDECREF(iterator); } + /* + * Log warning if more response content generated than was + * indicated, or less if there was no errors generated by + * the application. + */ + + if (self->content_length_set && ((!PyErr_Occurred() && + self->output_length != self->content_length) || + (self->output_length > self->content_length))) { + ap_log_rerror(APLOG_MARK, WSGI_LOG_DEBUG(0), self->r, + "mod_wsgi (pid=%d): Content length mismatch, " + "expected %s, response generated %s: %s", getpid(), + apr_off_t_toa(self->r->pool, self->content_length), + apr_off_t_toa(self->r->pool, self->output_length), + self->r->filename); + } + if (PyErr_Occurred()) { /* * Response content has already been sent, so cannot @@ -3944,23 +3961,6 @@ static int Adapter_run(AdapterObject *self, PyObject *object) Py_DECREF(start); Py_DECREF(vars); - /* - * Log warning if more response content generated than was - * indicated, or less if there was no errors generated by - * the application. - */ - - if (self->content_length_set && ((!PyErr_Occurred() && - self->output_length != self->content_length) || - (self->output_length > self->content_length))) { - ap_log_rerror(APLOG_MARK, WSGI_LOG_DEBUG(0), self->r, - "mod_wsgi (pid=%d): Content length mismatch, " - "expected %s, response generated %s: %s", getpid(), - apr_off_t_toa(self->r->pool, self->content_length), - apr_off_t_toa(self->r->pool, self->output_length), - self->r->filename); - } - /* Log details of any final Python exceptions. */ if (PyErr_Occurred()) |