From: cantor Date: Fri, 15 Feb 2008 00:14:44 +0000 (+0000) Subject: Set status before sending headers. X-Git-Tag: 2.4~549 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fsp.git;a=commitdiff_plain;h=6a94838691c4ad05cb145e8c211229896826feb7 Set status before sending headers. Only return non-DONE result on Apache 2+ git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2737 cb58f699-b61c-0410-a6fe-9272a202ed29 --- diff --git a/apache/mod_apache.cpp b/apache/mod_apache.cpp index 11a8106..c67b06d 100644 --- a/apache/mod_apache.cpp +++ b/apache/mod_apache.cpp @@ -500,17 +500,18 @@ public: ap_table_add(m_req->err_headers_out, name, value); } long sendResponse(istream& in, long status) { + if (status != XMLTOOLING_HTTP_STATUS_OK) + m_req->status = status; ap_send_http_header(m_req); char buf[1024]; while (in) { in.read(buf,1024); ap_rwrite(buf,in.gcount(),m_req); } - if (status != XMLTOOLING_HTTP_STATUS_OK) { - m_req->status = status; - if (status != XMLTOOLING_HTTP_STATUS_ERROR) - return status; - } +#if (defined(SHIB_APACHE_20) || defined(SHIB_APACHE_22)) + if (status != XMLTOOLING_HTTP_STATUS_OK && status != XMLTOOLING_HTTP_STATUS_ERROR) + return status; +#endif return DONE; } long sendRedirect(const char* url) {