File support-xforward.patch of Package rubygem-passenger

--- ext/apache2/Hooks.cpp.orig	2011-04-19 14:03:23.045693423 +0200
+++ ext/apache2/Hooks.cpp	2011-04-19 14:05:27.255500397 +0200
@@ -222,7 +222,7 @@
 	enum Threeway { YES, NO, UNKNOWN };
 
 	thread_specific_ptr<ApplicationPool::Client> threadSpecificApplicationPool;
-	Threeway m_hasModRewrite, m_hasModDir, m_hasModAutoIndex, m_hasModXsendfile;
+	Threeway m_hasModRewrite, m_hasModDir, m_hasModAutoIndex, m_hasModXsendfile, m_hasModXforward;
 	CachedFileStat cstat;
 	AgentsStarter agentsStarter;
 	AnalyticsLoggerPtr analyticsLogger;
@@ -380,6 +380,17 @@
 		return m_hasModXsendfile == YES;
 	}
 	
+	bool hasModXforward() {
+		if (m_hasModXforward == UNKNOWN) {
+			if (ap_find_linked_module("mod_xforward.c")) {
+				m_hasModXforward = YES;
+			} else {
+				m_hasModXforward = NO;
+			}
+		}
+		return m_hasModXforward == YES;
+	}
+	
 	int reportDocumentRootDeterminationError(request_rec *r) {
 		ap_set_content_type(r, "text/html; charset=UTF-8");
 		ap_rputs("<h1>Passenger error #1</h1>\n", r);
@@ -773,6 +784,8 @@
 				
 				bool xsendfile = hasModXsendfile() &&
 					apr_table_get(r->err_headers_out, "X-Sendfile");
+				bool xforward = hasModXforward() &&
+					apr_table_get(r->err_headers_out, "X-Forward");
 				
 				UPDATE_TRACE_POINT();
 				ap_pass_brigade(r->output_filters, bb);
@@ -786,7 +799,7 @@
 						"this is normal. You might also want to increase Apache's "
 						"TimeOut configuration option if you experience this "
 						"problem often.");
-				} else if (!bucketState->completed && !xsendfile) {
+				} else if (!bucketState->completed && !xsendfile && !xforward) {
 					// mod_xsendfile drops the entire output bucket so
 					// suppress this message when mod_xsendfile is active.
 					P_WARN("Apache stopped forwarding the backend's response, "
@@ -1378,6 +1391,7 @@
 		m_hasModDir = UNKNOWN;
 		m_hasModAutoIndex = UNKNOWN;
 		m_hasModXsendfile = UNKNOWN;
+		m_hasModXforward = UNKNOWN;
 		
 		P_DEBUG("Initializing Phusion Passenger...");
 		ap_add_version_component(pconf, "Phusion_Passenger/" PASSENGER_VERSION);
openSUSE Build Service is sponsored by