From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Magnus Henoch Newsgroups: gmane.emacs.devel Subject: Change branch for HTTP chunking bug? Date: Mon, 10 Mar 2008 11:47:55 +0100 Message-ID: <87d4q2ua78.fsf@freemail.hu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1205146105 30500 80.91.229.12 (10 Mar 2008 10:48:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Mar 2008 10:48:25 +0000 (UTC) Cc: 42@emacsbugs.donarmstrong.com To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 10 11:48:53 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 1JYfYo-0005oO-6D for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 11:48:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYfYF-0007w6-LU for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 06:48:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYfY8-0007u0-Ur for emacs-devel@gnu.org; Mon, 10 Mar 2008 06:48:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYfY6-0007s9-Re for emacs-devel@gnu.org; Mon, 10 Mar 2008 06:48:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYfY6-0007rx-Hz for emacs-devel@gnu.org; Mon, 10 Mar 2008 06:48:06 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JYfY5-00012w-SE for emacs-devel@gnu.org; Mon, 10 Mar 2008 06:48:06 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JYfY3-0003e3-T3 for emacs-devel@gnu.org; Mon, 10 Mar 2008 10:48:03 +0000 Original-Received: from etthundrat.olf.sgsnet.se ([193.11.222.85]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Mar 2008 10:48:03 +0000 Original-Received: from mange by etthundrat.olf.sgsnet.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Mar 2008 10:48:03 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: etthundrat.olf.sgsnet.se Mail-Copies-To: never Jabber-Id: legoscia@jabber.cd.chalmers.se User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) Cancel-Lock: sha1:HgYwAbtgi6FSQINXcpfISi91ZEw= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:92020 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? Magnus --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=url-http.el.patch 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) --=-=-=--