[PATCH 3/7] web_server: Create a string object for SERVER_PORT variable.

Jelmer Vernooij jelmer at samba.org
Wed Nov 21 18:46:56 MST 2012


This matches the behaviour of other wsgi server implementations.
---
 source4/web_server/wsgi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source4/web_server/wsgi.c b/source4/web_server/wsgi.c
index 3f8141c..4d2b363 100644
--- a/source4/web_server/wsgi.c
+++ b/source4/web_server/wsgi.c
@@ -301,7 +301,7 @@ static PyObject *create_environ(bool tls, int content_length, struct http_header
 	}
 	
 	PyDict_SetItemString(env, "SERVER_NAME", PyString_FromString(servername));
-	PyDict_SetItemString(env, "SERVER_PORT", PyInt_FromLong(serverport));
+	PyDict_SetItemString(env, "SERVER_PORT", PyString_FromFormat("%d", serverport));
 	for (hdr = headers; hdr; hdr = hdr->next) {
 		char *name;
 		if (!strcasecmp(hdr->name, "Content-Type")) {
-- 
1.8.0



More information about the samba-technical mailing list