From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: bug#10768: 23.3; url-http misses data when last few bytes are in 2nd packet and content-length is used Date: Thu, 09 Feb 2012 16:43:27 +0100 Message-ID: References: <20120208235321.00003609@unknown> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1328802254 15328 80.91.229.3 (9 Feb 2012 15:44:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Feb 2012 15:44:14 +0000 (UTC) Cc: 10768@debbugs.gnu.org To: "Christopher J. White" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 09 16:44:11 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RvWAK-00015M-DY for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Feb 2012 16:44:08 +0100 Original-Received: from localhost ([::1]:34136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvWAK-00041Y-0K for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Feb 2012 10:44:08 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:40973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvWAC-000414-Nb for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2012 10:44:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvWA7-0003RY-3h for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2012 10:44:00 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvWA6-0003RT-Vs for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2012 10:43:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RvWBC-00026e-MB for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2012 10:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Feb 2012 15:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10768 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10768-submit@debbugs.gnu.org id=B10768.13288022968069 (code B ref 10768); Thu, 09 Feb 2012 15:45:02 +0000 Original-Received: (at 10768) by debbugs.gnu.org; 9 Feb 2012 15:44:56 +0000 Original-Received: from localhost ([127.0.0.1]:33979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RvWB2-000263-Rg for submit@debbugs.gnu.org; Thu, 09 Feb 2012 10:44:56 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.9]:51821) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RvWAu-00025h-4z for 10768@debbugs.gnu.org; Thu, 09 Feb 2012 10:44:48 -0500 Original-Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 891A81C1DA12; Thu, 9 Feb 2012 16:43:28 +0100 (CET) X-Auth-Info: wWUr0HW35poWZJZkJZRQbDeGAwUtUdBkz+Vsws8LJ+E= Original-Received: from igel.home (ppp-88-217-114-208.dynamic.mnet-online.de [88.217.114.208]) by mail.mnet-online.de (Postfix) with ESMTPA id 455681C001F7; Thu, 9 Feb 2012 16:43:28 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 501) id 98A23CA299; Thu, 9 Feb 2012 16:43:27 +0100 (CET) X-Yow: Yow! Are we in the perfect mood? In-Reply-To: <20120208235321.00003609@unknown> (Christopher J. White's message of "Wed, 8 Feb 2012 23:53:21 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:56721 Archived-At: Does this help? diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index b43ed76..140824f 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -352,11 +352,14 @@ request.") ;; Parsing routines (defun url-http-clean-headers () "Remove trailing \r from header lines. -This allows us to use `mail-fetch-field', etc." +This allows us to use `mail-fetch-field', etc. +Return the number of characters removed." (declare (special url-http-end-of-headers)) - (goto-char (point-min)) - (while (re-search-forward "\r$" url-http-end-of-headers t) - (replace-match ""))) + (let ((end (marker-position url-http-end-of-headers))) + (goto-char (point-min)) + (while (re-search-forward "\r$" url-http-end-of-headers t) + (replace-match "")) + (- end url-http-end-of-headers))) (defun url-http-handle-authentication (proxy) (declare (special status success url-http-method url-http-data @@ -1051,7 +1054,7 @@ the end of the document." (setq url-http-end-of-headers (set-marker (make-marker) (point)) end-of-headers t) - (url-http-clean-headers))) + (setq nd (- nd (url-http-clean-headers)))) (if (not end-of-headers) ;; Haven't seen the end of the headers yet, need to wait Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."