Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 96784 invoked from network); 19 May 2006 22:37:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 May 2006 22:37:00 -0000 Received: (qmail 63084 invoked by uid 500); 19 May 2006 22:36:53 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 62928 invoked by uid 500); 19 May 2006 22:36:53 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 62355 invoked by uid 99); 19 May 2006 22:36:52 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 May 2006 15:36:51 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of rooneg@gmail.com designates 64.233.184.238 as permitted sender) Received: from [64.233.184.238] (HELO wr-out-0506.google.com) (64.233.184.238) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 May 2006 15:36:50 -0700 Received: by wr-out-0506.google.com with SMTP id i7so730673wra for ; Fri, 19 May 2006 15:36:30 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=Kp1WQHC8f1gVi7pf/W1WXREGIyBUNZULQnnI9+LkD9KA4rCb1IWXxKnxt5Y26uH40s3gxM7c3573nxhHrJgW6ayuudC7vx3zIkfkyd5F/EPBdVKs6O8b2q2xPvmaaRKczFSI+T2bKIicAXilOn6mpgNYieh6pn3G/6tOmmHNBnA= Received: by 10.54.152.11 with SMTP id z11mr2415140wrd; Fri, 19 May 2006 15:36:30 -0700 (PDT) Received: by 10.54.71.15 with HTTP; Fri, 19 May 2006 15:36:30 -0700 (PDT) Message-ID: <7edfeeef0605191536q5401a7f6kff078ff61819f82@mail.gmail.com> Date: Fri, 19 May 2006 15:36:30 -0700 From: "Garrett Rooney" Sender: rooneg@gmail.com To: "HTTPD Dev List" Subject: mod_dav spamming over r->status MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Google-Sender-Auth: 05fd2b384c202b31 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N So I've got this module that works as an input filter. It sits in front of mod_dav_svn and parses incoming REPORT requests, and when it determines that something is wrong it sets r->status and r->status_line and errors out by returning APR_EGENERAL. In HTTPD 2.0.x this works as I expect, the status line I set is sent back to the user. In HTTPD 2.2.x I just get a generic error (400 Bad Request). This seems kind of odd, so I looked into it. It turns out that the source of the difference is that in 2.2.1 we added code that sanity checks r->status and r->status_line, and only uses r->status_line if the number at the beginning matches r->status. It turns out that despite the fact that I set both r->status and r->status_line at the same time, by the time it hits basic_http_header_check in http_filters.c they're no longer the same. So where is r->status getting spammed? Well, it's actually deep in mod_dav. We call ap_xml_parse_input, which ends up causing our filter to get called and the underlying error gets returned. This means that HTTP_BAD_REQUEST gets returned up the stack. That eventually gets passed into ap_die, and in ap_die, which does the actual setting of r->status to HTTP_BAD_REQUEST, which means our r->status and r->status_line are out of sync, which means the status line gets ignored. So my first instinct is to fix this in the XML parsing code. If we get to the error case and r->status is already set to something interesting, we should return that instead of our default HTTP_BAD_REQUEST. Does that make sense? -garrett