GNU bug report logs - #8931
24.0.50; url-http.el terminating HTTP packets with extra carriage return and newline

Previous Next

Package: emacs;

Reported by: Nicolas Avrutin <nicolasavru <at> gmail.com>

Date: Fri, 24 Jun 2011 20:51:01 UTC

Severity: normal

Tags: fixed

Found in version 24.0.50

Fixed in version 24.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Avrutin <nicolasavru <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; url-http.el terminating HTTP packets with extra carriage
	return and newline
Date: Fri, 24 Jun 2011 15:45:36 -0400
[Message part 1 (text/plain, inline)]
`browse-url-emacs' and `url-retrieve-synchronously' (and probably other
functions) appear to be generating malformed HTTP packets by appending an
extra \r\n to the packet, resulting in them being terminated with "\r\n\r\n"
instead of "\r\n". Some pages (such as http://www.google.com) to still
return properly and just send back a packet saying that the sent packet was
malformed. Other pages, in my case last.fm's client API (access via
emms-lastfm-client) return 400 Bad Request. In addition, this causes
Wireshark to report the packet as "HEAD / HTTP/1.1 Continuation or non-HTTP
traffic".

Removing the "\r\n" on line 341 of url-http.el (see attached patch) removes
the duplicate "'\r\n" and appears to fix the issue. Calls to last.fm's
client API return 200 OK as expected and Wireshark properly reports the
packet as "HEAD / HTTP/1.1". Google, however, still reports a malformed
packet.

This bug is preset in Emacs 23.1, but is not in 23.2. My patch restores the
line to what it was in 23.2, but I do not know if it was changed for a
reason or in error.

--
Nicolas Avrutin
[Message part 2 (text/html, inline)]
[url-http.patch (text/x-patch, attachment)]

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

Previous Next


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