You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by Geert Jansen <ge...@boskant.nl> on 2003/03/02 15:28:50 UTC

More info concerning headers_out problem

Hi Grisha,

I did some more investigation of the headers_out problem I described
earlier. I can reproduce it reliably when these statements are true:

1. The requested file is a directory, mapped to a file with a
   DirectoryIndex directive.
2. There is a handler defined for any of the Access, Fixup or
   HeaderParser handlers.

Any other combination will not show the problem. Requesting the same
document with its proper URL instead of the directory works. Defining
any other handler than these works, only these three show the problem.
Defining the handlers is enough for the issue to show up, there is no
need to implement them.

The following hack short cuts the access handler and makes the problem
go away. If I put it one line lower, it won't work anymore. The httpd
will close the connection immediately.

<snip>
Index: mod_python.c
===================================================================
RCS file: /home/cvspublic/httpd-python/src/mod_python.c,v
retrieving revision 1.87
diff -u -r1.87 mod_python.c
--- mod_python.c        9 Jan 2003 19:43:56 -0000       1.87
+++ mod_python.c        2 Mar 2003 14:17:13 -0000
@@ -870,6 +870,9 @@
     /* determine interpreter to use */
     interp_name = select_interp_name(req, NULL, conf, hle, NULL, 0);
 
+    if (!strcmp(phase, "PythonAccessHandler"))
+       return OK;
+
     /* get/create interpreter */
     idata = get_interpreter(interp_name, req->server);
</snip>

My Python is 2.2.2, with threading enabled. I tried without threading,
but that didn't work: I get the following error:

  Fatal Python error: PyThreadState_Delete: tstate is still current

I am rather in the dark here, do you have an ideas what this may be?

Greetings,
Geert Jansen