Skip to content

Commit db1b98d

Browse files
APR 1.4.X doesn't have apr_hash_this_key().
1 parent 5715b5a commit db1b98d

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

docs/release-notes/version-4.6.1.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ Version 4.6.1 of mod_wsgi can be obtained from:
88

99
Bugs Fixed
1010
----------
11+
12+
* APR version 1.4.X on RHEL/CentOS doesn't have ``apr_hash_this_key()``
13+
function. Swap to using ``apr_hash_this()`` instead.

src/server/wsgi_interp.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2613,21 +2613,25 @@ void wsgi_publish_process_stopping(char *reason)
26132613
PyObject *event = NULL;
26142614
PyObject *object = NULL;
26152615

2616-
interp = wsgi_acquire_interpreter((char *)apr_hash_this_key(hi));
2616+
const void *key;
26172617

2618-
event = PyDict_New();
2618+
apr_hash_this(hi, &key, NULL, NULL);
2619+
2620+
interp = wsgi_acquire_interpreter((char *)key);
2621+
2622+
event = PyDict_New();
26192623

26202624
#if PY_MAJOR_VERSION >= 3
2621-
object = PyUnicode_DecodeLatin1(reason, strlen(reason), NULL);
2625+
object = PyUnicode_DecodeLatin1(reason, strlen(reason), NULL);
26222626
#else
2623-
object = PyString_FromString(reason);
2627+
object = PyString_FromString(reason);
26242628
#endif
2625-
PyDict_SetItemString(event, "shutdown_reason", object);
2626-
Py_DECREF(object);
2629+
PyDict_SetItemString(event, "shutdown_reason", object);
2630+
Py_DECREF(object);
26272631

2628-
wsgi_publish_event("process_stopping", event);
2632+
wsgi_publish_event("process_stopping", event);
26292633

2630-
Py_DECREF(event);
2634+
Py_DECREF(event);
26312635

26322636
wsgi_release_interpreter(interp);
26332637

0 commit comments

Comments
 (0)