From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Christopher J. White" 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, 9 Feb 2012 13:46:37 -0500 Message-ID: <20120209134637.00005ee1@unknown> References: <20120208235321.00003609@unknown> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1328813231 7377 80.91.229.3 (9 Feb 2012 18:47:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Feb 2012 18:47:11 +0000 (UTC) Cc: 10768@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 09 19:47:10 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 1RvZ1P-0001K5-MD for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Feb 2012 19:47:07 +0100 Original-Received: from localhost ([::1]:49203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvZ1P-0002Nr-8R for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Feb 2012 13:47:07 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:52586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvZ1H-000259-UU for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2012 13:47:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvZ1C-00063n-0q for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2012 13:46:59 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvZ1B-00063j-UF for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2012 13:46:53 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RvZ2I-0006Gx-6w for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2012 13:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Christopher J. White" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Feb 2012 18:48: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.132881327724098 (code B ref 10768); Thu, 09 Feb 2012 18:48:02 +0000 Original-Received: (at 10768) by debbugs.gnu.org; 9 Feb 2012 18:47:57 +0000 Original-Received: from localhost ([127.0.0.1]:34023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RvZ2C-0006GW-Nw for submit@debbugs.gnu.org; Thu, 09 Feb 2012 13:47:57 -0500 Original-Received: from mail15c25.carrierzone.com ([64.29.147.25]:35578) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RvZ28-0006GM-KJ for 10768@debbugs.gnu.org; Thu, 09 Feb 2012 13:47:55 -0500 X-POP-User: ajgrier.grierwhite.com Original-Received: from unknown (pool-108-49-4-207.bstnma.east.verizon.net [108.49.4.207]) by mail15c25.carrierzone.com (8.13.6/8.13.1) with ESMTP id q19IkcYJ031813; Thu, 9 Feb 2012 18:46:42 GMT In-Reply-To: X-Mailer: Claws Mail 3.8.0cvs6 (GTK+ 2.16.6; i586-pc-mingw32msvc) X-CSC: 0 X-CHA: v=1.1 cv=Iru08Ra2f8yZNR1/ykVqFZRxNF25rzdVns/bQLcDnmA= c=1 sm=1 a=hdTLrLAGt2gA:10 a=3pyGGIT-qAEA:10 a=kj9zAlcOel0A:10 a=iW5S9OHVd49uhICS+jddKg==:17 a=tBb2bbeoAAAA:8 a=cZ9j34NmEipaR1qePO0A:9 a=APF60CQRSNhWCpaWhUoA:7 a=CjuIK1q_8ugA:10 a=YuKU6ANggZ8A:10 a=u-AaD2zGYqUVSgAb:21 a=VQqgcTnmhXS0qg0t:21 a=iW5S9OHVd49uhICS+jddKg==:117 X-CTCH-Spam: Unknown X-CTCH-RefID: str=0001.0A02020A.4F341493.006E,ss=1,re=0.000,fgs=0 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:56729 Archived-At: Quick work! First past looks good, except you're missing one additional paren after the last diff line: - (url-http-clean-headers))) + (setq nd (- nd (url-http-clean-headers))))) Let me run this through a number of cases and see how well it holds up for a few days. Thanks ...cj On Thu, 09 Feb 2012 16:43:27 +0100 Andreas Schwab wrote: > 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. >