[mod_python] [PATCH] last httpd-2.0.36

Gary Benson gbenson at redhat.com
Tue Jul 16 10:15:59 EST 2002


Hi,

The attached patch brings the input filtering API in mod_python into line 
with that in httpd-2.0.36.  This is the last thing that I know of that 
needed fixing to work with 2.0.36, although I beleive some more fixes will 
be in order to build against 2.0.39 or whatever it is now :)

Cheers,
Gary

[ gbenson at redhat.com ][ GnuPG 85A8F78B ][ http://inauspicious.org/ ]
-------------- next part --------------
Bring input filter API in line with 2.0.36

Index: src/filterobject.c
===================================================================
RCS file: /cvsroot/modpython/mod_python/src/filterobject.c,v
retrieving revision 1.5
diff -u -r1.5 filterobject.c
--- src/filterobject.c	3 Jun 2002 14:31:15 -0000	1.5
+++ src/filterobject.c	9 Jul 2002 16:21:27 -0000
@@ -61,7 +61,7 @@
  */
 
 PyObject *MpFilter_FromFilter(ap_filter_t *f, apr_bucket_brigade *bb, int is_input,
-			      ap_input_mode_t mode, apr_size_t *readbytes,
+			      ap_input_mode_t mode, apr_size_t readbytes,
 			      char * handler, char *dir)
 {
     filterobject *result;
@@ -86,7 +86,7 @@
 	result->bb_in = bb;
 	result->bb_out = NULL;
 	result->mode = 0;
-	result->readbytes = NULL;
+	result->readbytes = 0;
     }
 
     result->closed = 0;
@@ -142,7 +142,7 @@
 
 	Py_BEGIN_ALLOW_THREADS;
 	self->rc = ap_get_brigade(self->f->next, self->bb_in, self->mode, 
-				  APR_BLOCK_READ, *self->readbytes);
+				  APR_BLOCK_READ, self->readbytes);
 	Py_END_ALLOW_THREADS;
 
 	if (! APR_STATUS_IS_SUCCESS(self->rc)) {
@@ -239,7 +239,7 @@
 
 		Py_BEGIN_ALLOW_THREADS;
 		self->rc = ap_get_brigade(self->f->next, self->bb_in, self->mode, 
-					  APR_BLOCK_READ, *self->readbytes);
+					  APR_BLOCK_READ, self->readbytes);
 		Py_END_ALLOW_THREADS;
 
 		if (! APR_STATUS_IS_SUCCESS(self->rc)) {
Index: src/mod_python.c
===================================================================
RCS file: /cvsroot/modpython/mod_python/src/mod_python.c,v
retrieving revision 1.60
diff -u -r1.60 mod_python.c
--- src/mod_python.c	3 Jun 2002 14:31:15 -0000	1.60
+++ src/mod_python.c	9 Jul 2002 16:21:35 -0000
@@ -1023,7 +1023,8 @@
 static apr_status_t python_filter(int is_input, ap_filter_t *f, 
 				  apr_bucket_brigade *bb,
 				  ap_input_mode_t mode,
-				  apr_size_t *readbytes) {
+				  apr_read_type_e block,
+				  apr_size_t readbytes) {
 
     PyObject *resultobject = NULL;
     interpreterdata *idata;
@@ -1052,8 +1053,7 @@
        so a fitler can spit out an error without causing infinite loop */
     if (ctx->transparent) {
 	if (is_input) 
-	    return ap_get_brigade(f->next, bb, mode, APR_BLOCK_READ, 
-				  *readbytes);
+	    return ap_get_brigade(f->next, bb, mode, block, readbytes);
 	else
 	    return ap_pass_brigade(f->next, bb);
     }
@@ -1201,9 +1201,10 @@
 static apr_status_t python_input_filter(ap_filter_t *f, 
 					apr_bucket_brigade *bb,
 					ap_input_mode_t mode,
-					apr_size_t *readbytes) 
+					apr_read_type_e block,
+					apr_off_t readbytes)
 {
-    return python_filter(1, f, bb, mode, readbytes);
+    return python_filter(1, f, bb, mode, block, readbytes);
 }
 
 
@@ -1216,7 +1217,7 @@
 static apr_status_t python_output_filter(ap_filter_t *f, 
 					 apr_bucket_brigade *bb)
 {
-    return python_filter(0, f, bb, 0, NULL);
+    return python_filter(0, f, bb, 0, 0, 0);
 }
 
 
Index: src/include/filterobject.h
===================================================================
RCS file: /cvsroot/modpython/mod_python/src/include/filterobject.h,v
retrieving revision 1.4
diff -u -r1.4 filterobject.h
--- src/include/filterobject.h	3 Jun 2002 14:31:16 -0000	1.4
+++ src/include/filterobject.h	9 Jul 2002 16:21:36 -0000
@@ -67,7 +67,7 @@
 
 	int is_input;
 	ap_input_mode_t mode;
-	apr_size_t *readbytes;
+	apr_size_t readbytes;
 
 	int closed;
 	int softspace;
@@ -88,7 +88,7 @@
     extern DL_IMPORT(PyObject *) 
 	MpFilter_FromFilter Py_PROTO((ap_filter_t *f, apr_bucket_brigade *bb_in, 
 				      int is_input, ap_input_mode_t mode, 
-				      apr_size_t *readbytes, char *hadler, char *dir));
+				      apr_size_t readbytes, char *hadler, char *dir));
 
 #ifdef __cplusplus
 }


More information about the Mod_python mailing list