unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jarosław Rzeszótko" <sztywny@gmail.com>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: 16220@debbugs.gnu.org
Subject: bug#16220: url-http.el: Not conforming to HTTP spec
Date: Mon, 23 Dec 2013 07:51:57 +0100	[thread overview]
Message-ID: <CAHnYAZbcgts3siT6ELhAfz0g2q+JBrZWE-JXtQdxFC4qWg-eGQ@mail.gmail.com> (raw)
In-Reply-To: <87wqiwbjne.fsf@flea.lifelogs.com>

Hi,

No, this does not seem directly related - I can't reproduce the GH
error neither with or without my fix, and from the discussion at the
end of the GH issue, it seems it has been fixed by the elpa guys by
adjusting server configuration.

As for the validity of the fix, I found the passage in the spec the
addresses this issue directly (once again from
http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html):

"Certain buggy HTTP/1.0 client implementations generate extra CRLF's
after a POST request. To restate what is explicitly forbidden by the
BNF, an HTTP/1.1 client MUST NOT preface or follow a request with an
extra CRLF."

The BNF this refers to is this:

generic-message = start-line
                  *(message-header CRLF)
                  CRLF
                  [ message-body ]
start-line      = Request-Line | Status-Line

And finally:

"When a Content-Length is given in a message where a message-body is
allowed, its field value MUST exactly match the number of OCTETs in
the message-body. HTTP/1.1 user agents MUST notify the user when an
invalid length is received and detected."

I hope this is enough of a proof that the extra newline is a bug.

Cheers,
Jarosław Rzeszótko

2013/12/22 Ted Zlatanov <tzz@lifelogs.com>:
> On Sun, 22 Dec 2013 22:55:07 +0100 Jarosław Rzeszótko <sztywny@gmail.com> wrote:
>
> JR> To turn this into a concrete proposal: I suggest this part in url-http.el
> JR> (starting line 356 in trunk):
>
> JR> ;; End request
> JR> "\r\n"
> JR> ;; Any data
> JR> url-http-data
> JR> ;; If `url-http-data' is nil, avoid two CRLFs (Bug#8931).
> JR> (if url-http-data "\r\n")))
>
> JR> Should read simply:
>
> JR> ;; End request
> JR> "\r\n"
> JR> ;; Any data
> JR> url-http-data))
> ...
> JR> Futhermore url-http-attempt-keepalives should be nil as default, or better
> JR> yet should be completely removed, as true keepalive connections are anyway
> JR> not currently supported on the Emacs side, are they?
>
> Jarosław,
>
> can you please check if your fix corrects
> https://github.com/milkypostman/melpa/issues/1193 which seems somewhat related?
>
> I don't know much about this area but your fix could help this annoying
> issue as well, if it's valid.
>
> Ted





  reply	other threads:[~2013-12-23  6:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-22 20:52 bug#16220: url-http.el: Not conforming to HTTP spec Jarosław Rzeszótko
2013-12-22 21:55 ` Jarosław Rzeszótko
2013-12-22 22:33   ` Ted Zlatanov
2013-12-23  6:51     ` Jarosław Rzeszótko [this message]
2013-12-23 13:08       ` Ted Zlatanov
2013-12-24  7:50   ` Lars Ingebrigtsen
2013-12-24  8:28     ` Jarosław Rzeszótko
2013-12-24 14:43 ` Stefan Monnier
2013-12-24 16:31   ` Jarosław Rzeszótko
2014-01-02  2:21     ` Stefan Monnier
2014-01-03 18:06       ` Jarosław Rzeszótko
2014-01-05  9:57       ` Lars Magne Ingebrigtsen
2014-01-05 13:25         ` Jarosław Rzeszótko
2014-01-06 15:06         ` Stefan Monnier
2014-01-07 19:30           ` Jarosław Rzeszótko
2014-01-08 18:29             ` Stefan Monnier
2014-01-18 22:35 ` Paul Eggert

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAHnYAZbcgts3siT6ELhAfz0g2q+JBrZWE-JXtQdxFC4qWg-eGQ@mail.gmail.com \
    --to=sztywny@gmail.com \
    --cc=16220@debbugs.gnu.org \
    --cc=tzz@lifelogs.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 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).