From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Jaros=C5=82aw_?= =?UTF-8?Q?Rzesz=C3=B3tko?= Newsgroups: gmane.emacs.bugs Subject: bug#16220: url-http.el: Not conforming to HTTP spec Date: Mon, 23 Dec 2013 07:51:57 +0100 Message-ID: References: <87wqiwbjne.fsf@flea.lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1387781591 4042 80.91.229.3 (23 Dec 2013 06:53:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Dec 2013 06:53:11 +0000 (UTC) Cc: 16220@debbugs.gnu.org To: Ted Zlatanov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 23 07:53:15 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VuzO6-0006L2-Pr for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Dec 2013 07:53:15 +0100 Original-Received: from localhost ([::1]:60562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuzO6-0006Ce-Fw for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Dec 2013 01:53:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuzNz-0006Bg-PI for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 01:53:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VuzNv-0008DG-Fk for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 01:53:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuzNv-0008DB-CY for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 01:53:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VuzNu-00024k-3r for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 01:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jaros=C5=82aw_?= =?UTF-8?Q?Rzesz=C3=B3tko?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Dec 2013 06:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16220 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16220-submit@debbugs.gnu.org id=B16220.13877815227869 (code B ref 16220); Mon, 23 Dec 2013 06:53:01 +0000 Original-Received: (at 16220) by debbugs.gnu.org; 23 Dec 2013 06:52:02 +0000 Original-Received: from localhost ([127.0.0.1]:35247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VuzMv-00022c-LN for submit@debbugs.gnu.org; Mon, 23 Dec 2013 01:52:02 -0500 Original-Received: from mail-pd0-f182.google.com ([209.85.192.182]:60499) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VuzMs-00022Q-Tp for 16220@debbugs.gnu.org; Mon, 23 Dec 2013 01:51:59 -0500 Original-Received: by mail-pd0-f182.google.com with SMTP id v10so4830212pde.13 for <16220@debbugs.gnu.org>; Sun, 22 Dec 2013 22:51:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=VHnVwjjQx89TXJGxTzNXlt+4DgUxL3+4etzPdG7Q/gQ=; b=F2TKmvn8noL6PoVk2hxZk/I6fnU8WPHYClahhcjCmuBwwBpMNDyoFDG+zcq2v42tuI jANhaR9R9shbxL4fip4T6qS082A4ySoVygYbvWKPvJZOCqPENJyZL9Rcpqcsgk5DfcvT 8LUtJSQnwsfACvDKc6K7CQDbNib8YK5j94TxETu/R6f/OjaCkIyAYy4AjCKb51g3Nxnm 0nlmaxjP+twKZz4u4bOrIY5uryzZM1CqzQ9uuZ/a4DDDbxbH0SDLPSaIk3gskjq70exb mmtNIuxDPUR3KdEbmMrGc6Vjd0V+3DtbvnfAmy4oHdF1hjec8P5Lb84O7zEbMM+MUOIL FDtA== X-Received: by 10.69.19.225 with SMTP id gx1mr24267305pbd.62.1387781517964; Sun, 22 Dec 2013 22:51:57 -0800 (PST) Original-Received: by 10.66.77.230 with HTTP; Sun, 22 Dec 2013 22:51:57 -0800 (PST) In-Reply-To: <87wqiwbjne.fsf@flea.lifelogs.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82426 Archived-At: Hi, No, this does not seem directly related - I can't reproduce the GH error neither with or without my fix, and from the discussion at the end of the GH issue, it seems it has been fixed by the elpa guys by adjusting server configuration. As for the validity of the fix, I found the passage in the spec the addresses this issue directly (once again from http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html): "Certain buggy HTTP/1.0 client implementations generate extra CRLF's after a POST request. To restate what is explicitly forbidden by the BNF, an HTTP/1.1 client MUST NOT preface or follow a request with an extra CRLF." The BNF this refers to is this: generic-message =3D start-line *(message-header CRLF) CRLF [ message-body ] start-line =3D Request-Line | Status-Line And finally: "When a Content-Length is given in a message where a message-body is allowed, its field value MUST exactly match the number of OCTETs in the message-body. HTTP/1.1 user agents MUST notify the user when an invalid length is received and detected." I hope this is enough of a proof that the extra newline is a bug. Cheers, Jaros=B3aw Rzesz=F3tko 2013/12/22 Ted Zlatanov : > On Sun, 22 Dec 2013 22:55:07 +0100 Jaros=B3aw Rzesz=F3tko wrote: > > JR> To turn this into a concrete proposal: I suggest this part in url-htt= p.el > JR> (starting line 356 in trunk): > > JR> ;; End request > JR> "\r\n" > JR> ;; Any data > JR> url-http-data > JR> ;; If `url-http-data' is nil, avoid two CRLFs (Bug#8931). > JR> (if url-http-data "\r\n"))) > > JR> Should read simply: > > JR> ;; End request > JR> "\r\n" > JR> ;; Any data > JR> url-http-data)) > ... > JR> Futhermore url-http-attempt-keepalives should be nil as default, or b= etter > JR> yet should be completely removed, as true keepalive connections are a= nyway > JR> not currently supported on the Emacs side, are they? > > Jaros=B3aw, > > can you please check if your fix corrects > https://github.com/milkypostman/melpa/issues/1193 which seems somewhat re= lated? > > I don't know much about this area but your fix could help this annoying > issue as well, if it's valid. > > Ted