Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C62A2200B33 for ; Wed, 29 Jun 2016 14:06:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C4CEC160A57; Wed, 29 Jun 2016 12:06:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E3439160A4D for ; Wed, 29 Jun 2016 14:06:17 +0200 (CEST) Received: (qmail 37091 invoked by uid 500); 29 Jun 2016 12:06:16 -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 37081 invoked by uid 99); 29 Jun 2016 12:06:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2016 12:06:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 4E1C0CD606 for ; Wed, 29 Jun 2016 12:06:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.029 X-Spam-Level: ** X-Spam-Status: No, score=2.029 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=rowe-clan-net.20150623.gappssmtp.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id bOKMlWYphrhd for ; Wed, 29 Jun 2016 12:06:12 +0000 (UTC) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 47F9F5F307 for ; Wed, 29 Jun 2016 12:06:11 +0000 (UTC) Received: by mail-it0-f42.google.com with SMTP id a5so117464290ita.1 for ; Wed, 29 Jun 2016 05:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rowe-clan-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=zICgcVmth3psJ/+el6YRwHwrzGb51aDdMygEAYjyWic=; b=e0z51p3OayEzGuJJ7UMQwHSvH5H31vThRpxXoMGY9fNXp9t+rq2Dkc8oZI578ujV3o Ey4RaPF+9JFkKqa4sHVyJSQDZHaIiYvlvQb1tRf3XlH8JBcH7T3RfC3S5bUnP/Zmogct CiesTPfAbHiOR8bSdXnxn8Gg4oD9pgYkwZ382hXfpFhC6UaKdmNKIKkf2FlLxLNuXDTh CKao8JftHXn7+x0xEmdw4fjOjA/DHYM2vKMI6kOY0YCadm9jFTIwCpWpCR1nJ6mGp5jv VOjFfgkRMePG0GrJwtHgoOWzuGkTEaxCew+lUUfYUc3ruMMksl+f1LqlAFMDClyHJvhq RW7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=zICgcVmth3psJ/+el6YRwHwrzGb51aDdMygEAYjyWic=; b=BkaQ9gtnu6OOwrgkrRLOHSMza1F6VvsykA6f1mJzJHOjGNiHeJdUEycxKd+VNsKF7V iln6lrEoUD4cSPhXKFu7DAzCR5FUc11I0mgN6buOoU852OVINh71502Cg6rleTG0Dgzf qKvd2rfGNJ/NWNXXKEHOodA0IOBkS8DfRoAcWZcGP7Ed7h6SOI+aMyLFE7z/109qFKZm eF553e8EvI86BWFJAFZL2pkXHyaWmGUg8SzzLmE/PTQzXP5g/SEeGzzUm/qd+gQHHSuO T/rWlA00cwTJnltCsI3FFyZDeQfP01hxj36MOyzoqYQKkuS1ZfzYPRYxUg/2iYDoX1qb o+5w== X-Gm-Message-State: ALyK8tLGJzJntuL1+nI1nyG3xyyo7Y7VWTEcz6kfl5KfvgvFzztSOHMgn0nDCeBclCbLGY2d/4KRDnd5oA+QEpW5 X-Received: by 10.36.55.138 with SMTP id r132mr20641775itr.73.1467201964877; Wed, 29 Jun 2016 05:06:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.16.216 with HTTP; Wed, 29 Jun 2016 05:06:04 -0700 (PDT) In-Reply-To: References: From: William A Rowe Jr Date: Wed, 29 Jun 2016 07:06:04 -0500 Message-ID: Subject: Re: Last-Modified header value returned by FCGI scripts To: httpd Content-Type: multipart/alternative; boundary=001a1140ae52ee5c150536699387 archived-at: Wed, 29 Jun 2016 12:06:19 -0000 --001a1140ae52ee5c150536699387 Content-Type: text/plain; charset=UTF-8 On Wed, Jun 29, 2016 at 3:12 AM, Luca Toscano wrote: > Hi Apache devs! > > I have been working on an email thread [1] in the users@ mailing list in > which it was asked some questions about how httpd (using mod-proxy-fcgi) > manages Last-Modified headers returned by FCGI/CGI scripts. Two strange > behaviors were brought up: > > 1) Last-Modified: foo returned by a simple PHP script forces httpd to > replace it with Thu, 01 Jan 1970 00:00:00 GMT. Patch proposed to backport: > http://svn.apache.org/r1748379 > Sensible, but we should be filling this in with now(), based on comments in 14.29? > 2) Last-Modified header value with a date not in GMT are replaced with > (now() + time taken to serve the request) without any trace in the logs. > This seems to be due to httpd recognizing the date as "in the future" and > replacing it with its response origination time (following > https://tools.ietf.org/html/rfc2616#section-14.29). > https://tools.ietf.org/html/rfc2616#section-3.3.1 declares these are meaningless, and we follow the appropriate recommendations. > To demonstrate 2), Manuel in users@ suggested a simple PHP script > returning the current datetime in the Europe/Paris timezone (GMT +2). I > tried to check the code and I came up with two possible solutions: > > 1) mod-proxy-fcgi eventually triggers a call > to ap_scan_script_header_err_core_ex in util_script.c that > uses apr_date_parse_http to transform a datestring into a unix timestamp. > This one seems not to check the timezone, assuming GMT all the times. It > might be an option to add a check in the code to return APR_DATE_BAD in > case the datetime is not GMT, and then r1748379 will take care of the rest. > This could potentially break existing code that relies on this behavior to > work correctly. > -0 on recognizing non-GMT, per section 3.3.1 of spec. > 2) Simply log what httpd does, for example with http://apaste.info/8pa or > http://apaste.info/JlZ (wording might need to be changed). > +1 in all cases to adding trace messages for sysadmins debugging bad cgi. Cheers, Bill --001a1140ae52ee5c150536699387 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On W= ed, Jun 29, 2016 at 3:12 AM, Luca Toscano <toscano.luca@gmail.com= > wrote:
Hi Apache devs!
I have been working on an email thread [1] in the users@ ma= iling list in which it was asked some questions about how httpd (using mod-= proxy-fcgi) manages Last-Modified headers returned by FCGI/CGI scripts. Two= strange behaviors were brought up:

1) Last-Modifi= ed: foo returned by a simple PHP script forces httpd to replace it with Thu= , 01 Jan 1970 00:00:00 GMT. Patch proposed to backport:=C2=A0http://svn.apache.org/r17483= 79

Sensible, but we should = be filling this in with now(), based on comments in 14.29?
=C2=A0=
2) Last-Modified header value = with a date not in GMT are replaced with (now() + time taken to serve the r= equest) without any trace in the logs. This seems to be due to httpd recogn= izing the date as "in the future" and replacing it with its respo= nse origination time (following=C2=A0https://tools.ietf.org/html/rfc26= 16#section-14.29).=C2=A0

https://tools.i= etf.org/html/rfc2616#section-3.3.1 declares these are meaningless, and = we follow the appropriate recommendations.
=C2=A0
To demonstrate 2), Manuel in users@= suggested a simple PHP script returning the current datetime in the Europe= /Paris timezone (GMT +2). I tried to check the code and I came up with two = possible solutions:

1) =C2=A0mod-proxy-fcgi eventu= ally triggers a call to=C2=A0ap_scan_script_header_err_core_ex in util_scri= pt.c that uses=C2=A0apr_date_parse_http to transform a datestring into a un= ix timestamp. This one seems not to check the timezone, assuming GMT all th= e times. It might be an option to add a check in the code to return APR_DAT= E_BAD in case the datetime is not GMT, and then=C2=A0r1748379 will take car= e of the rest. This could potentially break existing code that relies on th= is behavior to work correctly.

= -0 on recognizing non-GMT, per section 3.3.1 of spec.=C2=A0
=C2= =A0
2) Simply log wh= at httpd does, for example with=C2=A0http://apaste.info/8pa or=C2=A0http://apaste.info/JlZ (wording might need = to be changed).

+1 in all cases to adding trace messages for sysadmins d= ebugging bad cgi.

Cheers,

Bill
--001a1140ae52ee5c150536699387--