all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: "Christopher J. White" <chris@grierwhite.com>
Cc: 10768@debbugs.gnu.org
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	[thread overview]
Message-ID: <m2liocypuo.fsf@igel.home> (raw)
In-Reply-To: <20120208235321.00003609@unknown> (Christopher J. White's message of "Wed, 8 Feb 2012 23:53:21 -0500")

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."





  parent reply	other threads:[~2012-02-09 15:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09  4:53 bug#10768: 23.3; url-http misses data when last few bytes are in 2nd packet and content-length is used Christopher J. White
2012-02-09  9:15 ` Andreas Schwab
2012-02-09 12:49   ` Christopher J. White
2012-02-09 13:07     ` Andreas Schwab
2012-02-09 15:43 ` Andreas Schwab [this message]
2012-02-09 18:46   ` Christopher J. White
2012-02-09 20:14   ` Christopher J. White
2012-02-10 11:47     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2liocypuo.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=10768@debbugs.gnu.org \
    --cc=chris@grierwhite.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.