summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-24 03:54:47 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-21 16:03:52 +0200
commita4e8ff7429db8620a4d91e901295413560be6c91 (patch)
tree997a032c9a52f2f283f2fc90957930fb0b2df612 /source4
parent4bb17b60ef608b10284ccd2146c9344cc43b8637 (diff)
downloadsamba-a4e8ff7429db8620a4d91e901295413560be6c91.tar.gz
samba-a4e8ff7429db8620a4d91e901295413560be6c91.tar.bz2
samba-a4e8ff7429db8620a4d91e901295413560be6c91.zip
Add more parts of the WSGI implementation.
Diffstat (limited to 'source4')
-rw-r--r--source4/web_server/wsgi.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/source4/web_server/wsgi.c b/source4/web_server/wsgi.c
index 50f8599869..3253873de2 100644
--- a/source4/web_server/wsgi.c
+++ b/source4/web_server/wsgi.c
@@ -41,9 +41,32 @@ static PyObject *start_response(PyObject *args, PyObject *kwargs)
return NULL;
}
+/*
+ * read(size) input 1
+ * readline() input 1,2
+ * readlines(hint) input 1,3
+ * __iter__() input
+ * flush() errors 4
+ * write(str) errors
+ * writelines(seq) errors
+ */
+
+static PyObject *Py_InputHttpStream(void *foo)
+{
+ /* FIXME */
+ return NULL;
+}
+
+static PyObject *Py_ErrorHttpStream(void)
+{
+ /* FIXME */
+ return NULL;
+}
+
static PyObject *create_environ(void)
{
PyObject *env, *osmodule, *osenviron;
+ PyObject *inputstream, *errorstream;
osmodule = PyImport_ImportModule("os");
if (osmodule == NULL)
@@ -53,8 +76,23 @@ static PyObject *create_environ(void)
env = PyDict_Copy(osenviron);
- PyDict_SetItemString(env, "wsgi.input", NULL); /* FIXME */
- PyDict_SetItemString(env, "wsgi.errors", NULL); /* FIXME */
+ Py_DECREF(env);
+
+ inputstream = Py_InputHttpStream(NULL); /* FIXME */
+ if (inputstream == NULL) {
+ Py_DECREF(env);
+ return NULL;
+ }
+
+ errorstream = Py_ErrorHttpStream();
+ if (errorstream == NULL) {
+ Py_DECREF(env);
+ Py_DECREF(inputstream);
+ return NULL;
+ }
+
+ PyDict_SetItemString(env, "wsgi.input", inputstream);
+ PyDict_SetItemString(env, "wsgi.errors", errorstream);
PyDict_SetItemString(env, "wsgi.version", Py_BuildValue("(i,i)", 1, 0));
PyDict_SetItemString(env, "wsgi.multithread", Py_False);
PyDict_SetItemString(env, "wsgi.multiprocess", Py_True);