[mod_python] [PATCH] more httpd-2.0.36

Gary Benson gbenson at redhat.com
Tue May 28 12:31:05 EST 2002


Hi,

The attached patches fix most of the compiler warnings when building
against httpd-2.0.36: some const correctness stuff, and a problem with
conn.remote_addr. The rest of the problems stem from the fact that the
input filter API changed in 2.0.31, but I currently have no idea how to
fix that.

Cheers,
Gary

[ gbenson at redhat.com ][ GnuPG 85A8F78B ][ http://inauspicious.org/ ]
-------------- next part --------------
apr_table_elts() returns const apr_array_header_t *

Index: src/tableobject.c
===================================================================
RCS file: /cvsroot/modpython/mod_python/src/tableobject.c,v
retrieving revision 1.8
diff -u -r1.8 tableobject.c
--- src/tableobject.c	28 Nov 2001 05:31:48 -0000	1.8
+++ src/tableobject.c	28 May 2002 11:12:59 -0000
@@ -196,7 +196,7 @@
 {
 
     PyObject *v;
-    apr_array_header_t *ah;
+    const apr_array_header_t *ah;
     apr_table_entry_t *elts;
     int i, j;
 
@@ -303,7 +303,7 @@
 static PyObject * table_repr(tableobject *self)
 {
     PyObject *s;
-    apr_array_header_t *ah;
+    const apr_array_header_t *ah;
     apr_table_entry_t *elts;
     int i;
 
Index: src/requestobject.c
===================================================================
RCS file: /cvsroot/modpython/mod_python/src/requestobject.c,v
retrieving revision 1.15
diff -u -r1.15 requestobject.c
--- src/requestobject.c	28 Nov 2001 05:31:48 -0000	1.15
+++ src/requestobject.c	28 May 2002 11:13:04 -0000
@@ -268,7 +268,7 @@
 
     if (apr_table_get(self->request_rec->notes, "py_more_directives")) {
 
-	apr_array_header_t *ah = apr_table_elts(self->request_rec->notes);
+	const apr_array_header_t *ah = apr_table_elts(self->request_rec->notes);
 	apr_table_entry_t *elts = (apr_table_entry_t *)ah->elts;
 	int i = ah->nelts;
 
Index: src/mod_python.c
===================================================================
RCS file: /cvsroot/modpython/mod_python/src/mod_python.c,v
retrieving revision 1.59
diff -u -r1.59 mod_python.c
--- src/mod_python.c	5 Mar 2002 01:43:39 -0000	1.59
+++ src/mod_python.c	28 May 2002 11:13:13 -0000
@@ -1545,7 +1545,7 @@
 static void PythonChildInitHandler(apr_pool_t *p, server_rec *s)
 {
 
-    apr_array_header_t *ah;
+    const apr_array_header_t *ah;
     apr_table_entry_t *elts;
     PyObject *sys, *path, *dirstr;
     interpreterdata *idata;
-------------- next part --------------
Make conn.remote_addr work properly

Index: src/connobject.c
===================================================================
RCS file: /cvsroot/modpython/mod_python/src/connobject.c,v
retrieving revision 1.7
diff -u -r1.7 connobject.c
--- src/connobject.c	18 Aug 2001 22:43:45 -0000	1.7
+++ src/connobject.c	28 May 2002 11:11:58 -0000
@@ -194,8 +194,7 @@
 	return PyInt_FromLong(self->conn->double_reverse);
     }
     else if (strcmp(name, "remote_addr") == 0) {
-	/* XXX this needs to be compatible with apr_sockaddr_t */
-	return makesockaddr(&(self->conn->remote_addr));
+	return makesockaddr(&self->conn->remote_addr->sa.sin);
     }
     else if (strcmp(name, "notes") == 0) {
 	Py_INCREF(self->notes);


More information about the Mod_python mailing list