You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by gr...@apache.org on 2002/10/04 20:56:18 UTC
cvs commit: httpd-python/src filterobject.c
grisha 2002/10/04 11:56:18
Modified: Doc modpython4.tex
src filterobject.c
Log:
Added filter.pass_on().
Revision Changes Path
1.26 +4 -0 httpd-python/Doc/modpython4.tex
Index: modpython4.tex
===================================================================
RCS file: /home/cvs/httpd-python/Doc/modpython4.tex,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- modpython4.tex 24 Sep 2002 16:01:28 -0000 1.25
+++ modpython4.tex 4 Oct 2002 18:56:17 -0000 1.26
@@ -1069,6 +1069,10 @@
\subsubsection{Filter Methods\label{pyapi-mpfilt-meth}}
+\begin{methoddesc}[filter]{pass_on}{}
+
+Passes all data throught the filter without any processing.
+
\begin{methoddesc}[filter]{read}{\optional{length}}
Reads at most \var{len} bytes from the next filter, returning a string
1.16 +21 -1 httpd-python/src/filterobject.c
Index: filterobject.c
===================================================================
RCS file: /home/cvs/httpd-python/src/filterobject.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- filterobject.c 1 Oct 2002 22:04:54 -0000 1.15
+++ filterobject.c 4 Oct 2002 18:56:18 -0000 1.16
@@ -118,6 +118,25 @@
}
/**
+ ** filter_pass_on
+ **
+ * just passes everything on
+ */
+
+static PyObject *filter_pass_on(filterobject *self)
+{
+ if (self->is_input)
+ self->rc = ap_get_brigade(self->f->next, self->bb_out,
+ self->mode, APR_BLOCK_READ,
+ self->readbytes);
+ else
+ self->rc = ap_pass_brigade(self->f->next, self->bb_in);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+/**
** _filter_read
**
* read from filter - works for both read() and readline()
@@ -445,6 +464,7 @@
}
static PyMethodDef filterobjectmethods[] = {
+ {"pass_on", (PyCFunction) filter_pass_on, METH_NOARGS},
{"read", (PyCFunction) filter_read, METH_VARARGS},
{"readline", (PyCFunction) filter_readline, METH_VARARGS},
{"write", (PyCFunction) filter_write, METH_VARARGS},