export x-wsgiorg.uwsgi.version in WSGI env

This commit is contained in:
roberto@sirius
2010-09-11 17:40:52 +02:00
parent 045001fd6c
commit 21e4cc19c8
2 changed files with 10 additions and 0 deletions
+2
View File
@@ -2593,6 +2593,7 @@ void uwsgi_wsgi_config(char *filename) {
}
}
wsgi_dict = PyModule_GetDict(wsgi_module);
if (!wsgi_dict) {
PyErr_Print();
@@ -2658,6 +2659,7 @@ void uwsgi_wsgi_config(char *filename) {
}
}
else {
app_app = PyDict_GetItemString(wsgi_dict, quick_callable);
}
if (app_app) {
+8
View File
@@ -81,11 +81,17 @@ int uwsgi_request_wsgi(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi_req
PyObject *pydictkey, *pydictvalue;
static PyObject *uwsgi_version = NULL;
char *path_info;
struct uwsgi_app *wi ;
int tmp_stderr;
if (uwsgi_version == NULL) {
uwsgi_version = PyString_FromString(UWSGI_VERSION);
}
#ifdef UWSGI_ASYNC
if (wsgi_req->async_status == UWSGI_AGAIN) {
// get rid of timeout
@@ -347,6 +353,8 @@ int uwsgi_request_wsgi(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi_req
PyDict_SetItemString(uwsgi->embedded_dict, "env", wsgi_req->async_environ);
PyDict_SetItemString(wsgi_req->async_environ, "x-wsgiorg.uwsgi.version", uwsgi_version);
#ifdef UWSGI_ROUTING
uwsgi_log("routing %d routes %d\n", uwsgi->routing, uwsgi->nroutes);