GNU bug report logs - #10768
23.3; url-http misses data when last few bytes are in 2nd packet and content-length is used

Previous Next

Package: emacs;

Reported by: "Christopher J. White" <chris <at> grierwhite.com>

Date: Thu, 9 Feb 2012 04:55:02 UTC

Severity: normal

Found in version 23.3

Done: Andreas Schwab <schwab <at> linux-m68k.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Christopher J. White" <chris <at> grierwhite.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 10768 <at> 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, 9 Feb 2012 13:46:37 -0500
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 <schwab <at> linux-m68k.org> 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.
> 





This bug report was last modified 13 years and 165 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.