unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Change branch for HTTP chunking bug?
@ 2008-03-10 10:47 Magnus Henoch
  2008-03-10 15:46 ` Chong Yidong
  2008-03-10 15:57 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Magnus Henoch @ 2008-03-10 10:47 UTC (permalink / raw)
  To: emacs-devel; +Cc: 42

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: url-http.el.patch --]
[-- Type: text/x-patch, Size: 707 bytes --]

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)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-11 12:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-10 10:47 Change branch for HTTP chunking bug? Magnus Henoch
2008-03-10 15:46 ` Chong Yidong
2008-03-10 15:57 ` Stefan Monnier
2008-03-11 12:19   ` Magnus Henoch
2008-03-11 12:23     ` Thien-Thi Nguyen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).