From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Change branch for HTTP chunking bug? Date: Mon, 10 Mar 2008 11:57:04 -0400 Message-ID: References: <87d4q2ua78.fsf@freemail.hu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205164650 1268 80.91.229.12 (10 Mar 2008 15:57:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Mar 2008 15:57:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 10 16:57:57 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JYkNk-0006tq-Ry for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 16:57:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYkNC-0007BK-Pe for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 11:57:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYkN9-0007B5-1y for emacs-devel@gnu.org; Mon, 10 Mar 2008 11:57:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYkN7-00079v-GI for emacs-devel@gnu.org; Mon, 10 Mar 2008 11:57:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYkN7-00079s-5q for emacs-devel@gnu.org; Mon, 10 Mar 2008 11:57:05 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JYkN7-0004yX-08 for emacs-devel@gnu.org; Mon, 10 Mar 2008 11:57:05 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmgCABT31EfO+J2CdGdsb2JhbACQfgEwmDSBBw X-IronPort-AV: E=Sophos;i="4.25,474,1199682000"; d="scan'208";a="15794298" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 10 Mar 2008 11:57:04 -0400 Original-Received: from pastel.home ([206.248.157.130]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id QSP06704; Mon, 10 Mar 2008 11:57:04 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0DBA1805A; Mon, 10 Mar 2008 11:57:04 -0400 (EDT) In-Reply-To: <87d4q2ua78.fsf@freemail.hu> (Magnus Henoch's message of "Mon, 10 Mar 2008 11:47:55 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:92046 Archived-At: > I recently committed the attached patch to trunk, fixing bug #42, > "Superfluous CR from HTTP chunked download": > http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=42 > Should this be changed on the Emacs 22 branch as well? It seems that the bug is also present on the 22 branch. I'm not sure how serious it is compared to the risk of introducing more bugs. How confident are you that this is the right fix and that it will not break anything currently working? Stefan > diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el > index 7b29eba..c9cecea 100644 > --- a/lisp/url/url-http.el > +++ b/lisp/url/url-http.el > @@ -948,7 +948,11 @@ the end of the document." > (url-http-debug "Saw end of stream chunk!") > (setq read-next-chunk nil) > (url-display-percentage nil nil) > - (goto-char (match-end 1)) > + ;; Every chunk, even the last 0-length one, is > + ;; terminated by CRLF. Skip it. > + (when (looking-at "\r?\n") > + (url-http-debug "Removing terminator of last chunk") > + (delete-region (match-beginning 0) (match-end 0))) > (if (re-search-forward "^\r*$" nil t) > (url-http-debug "Saw end of trailers...")) > (if (url-http-parse-headers)