1 diff -ru mod_python-3.3.1.orig/src/mod_python.c mod_python-3.3.1/src/mod_python.c
2 --- mod_python-3.3.1.orig/src/mod_python.c 2006-11-09 07:21:23.000000000 +0100
3 +++ mod_python-3.3.1/src/mod_python.c 2011-12-21 16:59:16.171960122 +0100
9 +int mod_python_got_killed;
10 +void sig_term_during_python(int s)
12 + mod_python_got_killed = 1;
18 @@ -1649,8 +1662,15 @@
19 * This is the C equivalent of
20 * >>> resultobject = obCallBack.Dispatch(request_object, phase)
22 + mod_python_got_killed = 0;
23 + sighandler_t orig_handler = signal(SIGTERM, sig_term_during_python);
24 resultobject = PyObject_CallMethod(idata->obcallback, "HandlerDispatch",
26 + signal(SIGTERM, orig_handler);
27 + if (mod_python_got_killed) {
28 + ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, req, "Got SIGTERM while Python running.");
32 /* clear phase from request object */
33 Py_XDECREF(request_obj->phase);