aboutsummaryrefslogtreecommitdiff
blob: 86694bfabcc0ed48c3d8ac59b5908d6cb7c40391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Sólo en mod_mono-2.10.new/: attachment.cgi?id=402888
diff -ur mod_mono-2.10/configure.in mod_mono-2.10.new/configure.in
--- mod_mono-2.10/configure.in	2011-01-13 23:32:35.000000000 +0100
+++ mod_mono-2.10.new/configure.in	2015-06-07 21:09:26.417127319 +0200
@@ -336,6 +336,16 @@
 ], [
 ])
 
+AC_TRY_RUN([
+	#include <ap_release.h>
+	int main ()
+	{
+		return (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER == 4) ? 0 : 1;
+	}
+], [
+	APACHE_VER=2.4
+], [
+])
 fi
 
 if test ! "$APACHE_VER" = "1.3" -a ! "$APACHE_VER" = "retry" ; then
@@ -385,6 +395,10 @@
 	AC_DEFINE([APACHE22],,[Compiling for Apache >= 2.2 ])
 fi
 
+if test "$APACHE_VER" = "2.4" ; then
+	AC_DEFINE([APACHE24],,[Compiling for Apache >= 2.4 ])
+fi
+
 # check for --with-mono-default-config-dir
 DFLT_MONO_CONFIG_DIR=`$APXS -q SYSCONFDIR`/mod-mono-applications
 AC_ARG_WITH(mono-default-config-dir,
diff -ur mod_mono-2.10/src/mod_mono.c mod_mono-2.10.new/src/mod_mono.c
--- mod_mono-2.10/src/mod_mono.c	2011-01-13 23:32:35.000000000 +0100
+++ mod_mono-2.10.new/src/mod_mono.c	2015-06-07 21:09:26.421127351 +0200
@@ -386,7 +386,11 @@
 apache_get_userid ()
 {
 #ifdef HAVE_UNIXD
-	return unixd_config.user_id;
+#if defined(APACHE24)
+  return ap_unixd_config.user_id;
+#else
+  return unixd_config.user_id;
+#endif
 #else
 	return ap_user_id;
 #endif
@@ -396,7 +400,11 @@
 apache_get_groupid ()
 {
 #ifdef HAVE_UNIXD
-	return unixd_config.group_id;
+#if defined(APACHE24)
+	return ap_unixd_config.user_id;
+#else
+  return unixd_config.user_id;
+#endif
 #else
 	return ap_group_id;
 #endif
@@ -406,7 +414,11 @@
 apache_get_username ()
 {
 #ifdef HAVE_UNIXD
+#if defined(APACHE24)
+	return ap_unixd_config.user_name;
+#else 
 	return unixd_config.user_name;
+#endif
 #else
 	return ap_user_name;
 #endif
@@ -485,8 +497,12 @@
 
 #if defined (AP_NEED_SET_MUTEX_PERMS) && defined (HAVE_UNIXD)
 		DEBUG_PRINT (1, "Setting mutex permissions for %s", xsp->dashboard_lock_file);
+#if defined(APACHE24)
+		rv = ap_unixd_set_global_mutex_perms (xsp->dashboard_mutex);
+#else 
 		rv = unixd_set_global_mutex_perms (xsp->dashboard_mutex);
-		if (rv != APR_SUCCESS) {
+#endif
+    if (rv != APR_SUCCESS) {
 			ap_log_error (APLOG_MARK, APLOG_CRIT, STATCODE_AND_SERVER (rv),
 				      "Failed to set mutex permissions for %s",
 				      xsp->dashboard_lock_file);
@@ -850,10 +866,14 @@
 #if defined(APACHE22)
 	return c->remote_addr->port;
 #else
+#if defined(APACHE24)
+  return c->client_addr->port;
+#else 
 	apr_port_t port;
 	apr_sockaddr_port_get (&port, c->remote_addr);
 	return port;
 #endif
+#endif
 
 }
 
@@ -863,10 +883,14 @@
 #if defined(APACHE22)
 	return r->connection->local_addr->port;
 #else
+#if defined(APACHE24)
+	return r->connection->local_addr->port;
+#else
 	apr_port_t port;
 	apr_sockaddr_port_get (&port, r->connection->local_addr);
 	return port;
 #endif
+#endif
 }
 
 static const char *
@@ -1977,9 +2001,12 @@
 	size += info.local_ip_len + sizeof (int32_t);
 
 	size += sizeof (int32_t);
-
-	info.remote_ip_len = strlen (r->connection->remote_ip);
-	size += info.remote_ip_len + sizeof (int32_t);
+#if defined(APACHE24)
+  info.remote_ip_len = strlen (r->connection->client_ip);
+#else 
+  info.remote_ip_len = strlen (r->connection->remote_ip);
+#endif
+  size += info.remote_ip_len + sizeof (int32_t);
 
 	size += sizeof (int32_t);
 
@@ -2026,7 +2053,11 @@
 	i = LE_FROM_INT (i);
 	memcpy (ptr, &i, sizeof (i));
 	ptr += sizeof (int32_t);
+#if defined(APACHE24)
+	ptr += write_string_to_buffer (ptr, 0, r->connection->client_ip, info.remote_ip_len);
+#else 
 	ptr += write_string_to_buffer (ptr, 0, r->connection->remote_ip, info.remote_ip_len);
+#endif
 	i = connection_get_remote_port (r->connection);
 	i = LE_FROM_INT (i);
 	memcpy (ptr, &i, sizeof (i));
Sólo en mod_mono-2.10.new/src: mod_mono.c.orig