summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Dumpleton <Graham.Dumpleton@gmail.com>2011-04-19 09:40:23 +1000
committerGraham Dumpleton <Graham.Dumpleton@gmail.com>2011-04-19 09:40:23 +1000
commite346fd0a14a32ccffe6929b4e416eb6e6b39306e (patch)
tree769fa10f930213ed447196fd72e050884cfe309e
parentdd56cff4920af492968d914ab8411695f3b6bdef (diff)
downloadmod_wsgi-e346fd0a14a32ccffe6929b4e416eb6e6b39306e.tar.gz
Move where content length mismatch log message generated as not picking up
case for exception properly.
-rw-r--r--.hgignore11
-rw-r--r--mod_wsgi.c36
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
diff --git a/mod_wsgi.c b/mod_wsgi.c
index 0d01674..50116cc 100644
--- a/mod_wsgi.c
+++ b/mod_wsgi.c
@@ -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())